Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZMdE-0001xG-Nm for qemu-devel@nongnu.org; Sat, 30 Aug 2008 05:20:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZMdB-0001wK-KC for qemu-devel@nongnu.org; Sat, 30 Aug 2008 05:20:30 -0400 Received: from [199.232.76.173] (port=33546 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZMd9-0001ve-T5 for qemu-devel@nongnu.org; Sat, 30 Aug 2008 05:20:28 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44583 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KZMd9-0007hH-Gk for qemu-devel@nongnu.org; Sat, 30 Aug 2008 05:20:27 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KZMd5-0001WF-4b for qemu-devel@nongnu.org; Sat, 30 Aug 2008 09:20:23 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KZMd4-0001WB-90 for qemu-devel@nongnu.org; Sat, 30 Aug 2008 09:20:22 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Sat, 30 Aug 2008 09:20:22 +0000 Subject: [Qemu-devel] [5113] Add correct stack bias if a 64 bit stack is used Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5113 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5113 Author: blueswir1 Date: 2008-08-30 09:20:21 +0000 (Sat, 30 Aug 2008) Log Message: ----------- Add correct stack bias if a 64 bit stack is used Modified Paths: -------------- trunk/linux-user/main.c Modified: trunk/linux-user/main.c =================================================================== --- trunk/linux-user/main.c 2008-08-29 23:01:41 UTC (rev 5112) +++ trunk/linux-user/main.c 2008-08-30 09:20:21 UTC (rev 5113) @@ -758,6 +758,7 @@ #endif #ifdef TARGET_SPARC +#define SPARC64_STACK_BIAS 2047 //#define DEBUG_WIN @@ -780,6 +781,10 @@ abi_ulong sp_ptr; sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)]; +#ifdef TARGET_SPARC64 + if (sp_ptr & 3) + sp_ptr += SPARC64_STACK_BIAS; +#endif #if defined(DEBUG_WIN) printf("win_overflow: sp_ptr=0x" TARGET_ABI_FMT_lx " save_cwp=%d\n", sp_ptr, cwp1); @@ -822,6 +827,10 @@ /* restore the invalid window */ cwp1 = cpu_cwp_inc(env, env->cwp + 1); sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)]; +#ifdef TARGET_SPARC64 + if (sp_ptr & 3) + sp_ptr += SPARC64_STACK_BIAS; +#endif #if defined(DEBUG_WIN) printf("win_underflow: sp_ptr=0x" TARGET_ABI_FMT_lx " load_cwp=%d\n", sp_ptr, cwp1);