From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxdbz-0002yK-TP for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:46:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxdbt-0004YK-QJ for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:46:47 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:46069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxdbt-0004Y9-Jx for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:46:41 -0400 From: Leon Alrae Date: Thu, 19 Jun 2014 15:45:33 +0100 Message-ID: <1403189143-54609-3-git-send-email-leon.alrae@imgtec.com> In-Reply-To: <1403189143-54609-1-git-send-email-leon.alrae@imgtec.com> References: <1403189143-54609-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 02/12] target-mips: update cpu_save/cpu_load to support KScratch registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: yongbok.kim@imgtec.com, cristian.cuna@imgtec.com, leon.alrae@imgtec.com, aurelien@aurel32.net Signed-off-by: Leon Alrae --- target-mips/machine.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/target-mips/machine.c b/target-mips/machine.c index 0496faa..966c5ef 100644 --- a/target-mips/machine.c +++ b/target-mips/machine.c @@ -144,6 +144,9 @@ void cpu_save(QEMUFile *f, void *opaque) qemu_put_sbe32s(f, &env->CP0_DataHi); qemu_put_betls(f, &env->CP0_ErrorEPC); qemu_put_sbe32s(f, &env->CP0_DESAVE); + for (i = 0; i < MIPS_KSCRATCH_NUM; i++) { + qemu_put_betls(f, &env->CP0_KScratch[i]); + } /* Save inactive TC state */ for (i = 0; i < MIPS_SHADOW_SET_MAX; i++) @@ -301,6 +304,11 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) qemu_get_sbe32s(f, &env->CP0_DataHi); qemu_get_betls(f, &env->CP0_ErrorEPC); qemu_get_sbe32s(f, &env->CP0_DESAVE); + if (version_id >= 4) { + for (i = 0; i < MIPS_KSCRATCH_NUM; i++) { + qemu_get_betls(f, &env->CP0_KScratch[i]); + } + } /* Load inactive TC state */ for (i = 0; i < MIPS_SHADOW_SET_MAX; i++) { -- 1.7.5.4