Commit 7caa33f7be98baa7d4ff6ceb280ef128c9c63bb2
1 parent
0ecdffbb
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
Showing
1 changed file
with
6 additions
and
2 deletions
target-i386/machine.c
... | ... | @@ -32,6 +32,7 @@ void cpu_save(QEMUFile *f, void *opaque) |
32 | 32 | CPUState *env = opaque; |
33 | 33 | uint16_t fptag, fpus, fpuc, fpregs_format; |
34 | 34 | uint32_t hflags; |
35 | + int32_t a20_mask; | |
35 | 36 | int i; |
36 | 37 | |
37 | 38 | for(i = 0; i < CPU_NB_REGS; i++) |
... | ... | @@ -100,7 +101,8 @@ void cpu_save(QEMUFile *f, void *opaque) |
100 | 101 | qemu_put_betls(f, &env->dr[i]); |
101 | 102 | |
102 | 103 | /* MMU */ |
103 | - qemu_put_be32s(f, &env->a20_mask); | |
104 | + a20_mask = (int32_t) env->a20_mask; | |
105 | + qemu_put_be32s(f, &a20_mask); | |
104 | 106 | |
105 | 107 | /* XMM */ |
106 | 108 | qemu_put_be32s(f, &env->mxcsr); |
... | ... | @@ -150,6 +152,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) |
150 | 152 | int i, guess_mmx; |
151 | 153 | uint32_t hflags; |
152 | 154 | uint16_t fpus, fpuc, fptag, fpregs_format; |
155 | + int32_t a20_mask; | |
153 | 156 | |
154 | 157 | if (version_id != 3 && version_id != 4) |
155 | 158 | return -EINVAL; |
... | ... | @@ -238,7 +241,8 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) |
238 | 241 | qemu_get_betls(f, &env->dr[i]); |
239 | 242 | |
240 | 243 | /* MMU */ |
241 | - qemu_get_be32s(f, &env->a20_mask); | |
244 | + qemu_get_be32s(f, &a20_mask); | |
245 | + env->a20_mask = a20_mask; | |
242 | 246 | |
243 | 247 | qemu_get_be32s(f, &env->mxcsr); |
244 | 248 | for(i = 0; i < CPU_NB_REGS; i++) { | ... | ... |