Message ID | 1403189143-54609-3-git-send-email-leon.alrae@imgtec.com |
---|---|
State | New |
Headers | show |
You must update CPU_SAVE_VERSION when you change the contents of the save data. For extra credit, consider updating target-mips to VMStateDescription structure(s). r~
On 19/06/2014 18:43, Richard Henderson wrote: > You must update CPU_SAVE_VERSION when you change the contents of the save data. > > For extra credit, consider updating target-mips to VMStateDescription structure(s). > > > r~ > v2 contains updated CPU_SAVE_VERSION. VMStateDescription structures sound like nice to have in target-mips - at the moment I'm not able to look at this, but I'll keep that in mind. Thanks, Leon
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++) {
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com> --- target-mips/machine.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)