Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOwKR-0003UV-T5 for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:14:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOwKR-0003UB-J6 for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:14:03 -0400 Received: from [199.232.76.173] (port=53271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOwKR-0003U4-7g for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:14:03 -0400 Received: from savannah.gnu.org ([199.232.41.3]:39421 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 1KOwKQ-0008CG-HK for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:14:02 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KOwKN-0000xa-K2 for qemu-devel@nongnu.org; Fri, 01 Aug 2008 15:13:59 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KOwKN-0000xF-7A for qemu-devel@nongnu.org; Fri, 01 Aug 2008 15:13:59 +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: Fri, 01 Aug 2008 15:13:59 +0000 Subject: [Qemu-devel] [4980] Handle wrapped registers correctly when saving 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: 4980 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4980 Author: blueswir1 Date: 2008-08-01 15:13:58 +0000 (Fri, 01 Aug 2008) Log Message: ----------- Handle wrapped registers correctly when saving Fix typo Save and load interrupt_index and pil_in Original patch by Luis Pureza Modified Paths: -------------- trunk/target-sparc/machine.c Modified: trunk/target-sparc/machine.c =================================================================== --- trunk/target-sparc/machine.c 2008-08-01 15:12:34 UTC (rev 4979) +++ trunk/target-sparc/machine.c 2008-08-01 15:13:58 UTC (rev 4980) @@ -31,6 +31,10 @@ int i; uint32_t tmp; + // if env->cwp == env->nwindows - 1, this will set the ins of the last + // window as the outs of the first window + cpu_set_cwp(env, env->cwp); + for(i = 0; i < 8; i++) qemu_put_betls(f, &env->gregs[i]); qemu_put_be32s(f, &env->nwindows); @@ -54,6 +58,9 @@ qemu_put_be32(f, tmp); qemu_put_betls(f, &env->fsr); qemu_put_betls(f, &env->tbr); + tmp = env->interrupt_index; + qemu_put_be32(f, tmp); + qemu_put_be32s(f, &env->pil_in); #ifndef TARGET_SPARC64 qemu_put_be32s(f, &env->wim); /* MMU */ @@ -110,7 +117,7 @@ qemu_put_be64s(f, &env->hver); qemu_put_be64s(f, &env->hstick_cmpr); qemu_put_be64s(f, &env->ssr); - qemu_get_ptimer(f, env->hstick); + qemu_put_ptimer(f, env->hstick); #endif } @@ -147,6 +154,9 @@ PUT_PSR(env, tmp); qemu_get_betls(f, &env->fsr); qemu_get_betls(f, &env->tbr); + tmp = qemu_get_be32(f); + env->interrupt_index = tmp; + qemu_get_be32s(f, &env->pil_in); #ifndef TARGET_SPARC64 qemu_get_be32s(f, &env->wim); /* MMU */