summaryrefslogtreecommitdiff
path: root/target-i386/machine.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-04 20:11:44 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-04 20:11:44 +0000
commit3a491a2d59392950e888c22b992bb8dec887a80b (patch)
treef27e92c9687281c9ed9a87bc1b3e3992b394909e /target-i386/machine.c
parent1344f2df53f04b967e944acad3c136aa15000634 (diff)
downloadqemu-3a491a2d59392950e888c22b992bb8dec887a80b.tar.gz
qemu-3a491a2d59392950e888c22b992bb8dec887a80b.tar.bz2
qemu-3a491a2d59392950e888c22b992bb8dec887a80b.zip
Correctly save and restore env->a20_mask now that it is a 64-bit
variable. Noticed by Erik de Castro Lopo. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4334 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r--target-i386/machine.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 703c820023..f88d5ed811 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -32,6 +32,7 @@ void cpu_save(QEMUFile *f, void *opaque)
CPUState *env = opaque;
uint16_t fptag, fpus, fpuc, fpregs_format;
uint32_t hflags;
+ int32_t a20_mask;
int i;
for(i = 0; i < CPU_NB_REGS; i++)
@@ -100,7 +101,8 @@ void cpu_save(QEMUFile *f, void *opaque)
qemu_put_betls(f, &env->dr[i]);
/* MMU */
- qemu_put_be32s(f, &env->a20_mask);
+ a20_mask = (int32_t) env->a20_mask;
+ qemu_put_be32s(f, &a20_mask);
/* XMM */
qemu_put_be32s(f, &env->mxcsr);
@@ -150,6 +152,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
int i, guess_mmx;
uint32_t hflags;
uint16_t fpus, fpuc, fptag, fpregs_format;
+ int32_t a20_mask;
if (version_id != 3 && version_id != 4)
return -EINVAL;
@@ -238,7 +241,8 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_betls(f, &env->dr[i]);
/* MMU */
- qemu_get_be32s(f, &env->a20_mask);
+ qemu_get_be32s(f, &a20_mask);
+ env->a20_mask = a20_mask;
qemu_get_be32s(f, &env->mxcsr);
for(i = 0; i < CPU_NB_REGS; i++) {