Commit a7a044f29e288c64aafc8e82ccfeeb9c6aa49017
1 parent
bc0129d9
Handle wrapped registers correctly when saving
Fix typo Save and load interrupt_index and pil_in Original patch by Luis Pureza git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4980 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
1 deletions
target-sparc/machine.c
@@ -31,6 +31,10 @@ void cpu_save(QEMUFile *f, void *opaque) | @@ -31,6 +31,10 @@ void cpu_save(QEMUFile *f, void *opaque) | ||
31 | int i; | 31 | int i; |
32 | uint32_t tmp; | 32 | uint32_t tmp; |
33 | 33 | ||
34 | + // if env->cwp == env->nwindows - 1, this will set the ins of the last | ||
35 | + // window as the outs of the first window | ||
36 | + cpu_set_cwp(env, env->cwp); | ||
37 | + | ||
34 | for(i = 0; i < 8; i++) | 38 | for(i = 0; i < 8; i++) |
35 | qemu_put_betls(f, &env->gregs[i]); | 39 | qemu_put_betls(f, &env->gregs[i]); |
36 | qemu_put_be32s(f, &env->nwindows); | 40 | qemu_put_be32s(f, &env->nwindows); |
@@ -54,6 +58,9 @@ void cpu_save(QEMUFile *f, void *opaque) | @@ -54,6 +58,9 @@ void cpu_save(QEMUFile *f, void *opaque) | ||
54 | qemu_put_be32(f, tmp); | 58 | qemu_put_be32(f, tmp); |
55 | qemu_put_betls(f, &env->fsr); | 59 | qemu_put_betls(f, &env->fsr); |
56 | qemu_put_betls(f, &env->tbr); | 60 | qemu_put_betls(f, &env->tbr); |
61 | + tmp = env->interrupt_index; | ||
62 | + qemu_put_be32(f, tmp); | ||
63 | + qemu_put_be32s(f, &env->pil_in); | ||
57 | #ifndef TARGET_SPARC64 | 64 | #ifndef TARGET_SPARC64 |
58 | qemu_put_be32s(f, &env->wim); | 65 | qemu_put_be32s(f, &env->wim); |
59 | /* MMU */ | 66 | /* MMU */ |
@@ -110,7 +117,7 @@ void cpu_save(QEMUFile *f, void *opaque) | @@ -110,7 +117,7 @@ void cpu_save(QEMUFile *f, void *opaque) | ||
110 | qemu_put_be64s(f, &env->hver); | 117 | qemu_put_be64s(f, &env->hver); |
111 | qemu_put_be64s(f, &env->hstick_cmpr); | 118 | qemu_put_be64s(f, &env->hstick_cmpr); |
112 | qemu_put_be64s(f, &env->ssr); | 119 | qemu_put_be64s(f, &env->ssr); |
113 | - qemu_get_ptimer(f, env->hstick); | 120 | + qemu_put_ptimer(f, env->hstick); |
114 | #endif | 121 | #endif |
115 | } | 122 | } |
116 | 123 | ||
@@ -147,6 +154,9 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | @@ -147,6 +154,9 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | ||
147 | PUT_PSR(env, tmp); | 154 | PUT_PSR(env, tmp); |
148 | qemu_get_betls(f, &env->fsr); | 155 | qemu_get_betls(f, &env->fsr); |
149 | qemu_get_betls(f, &env->tbr); | 156 | qemu_get_betls(f, &env->tbr); |
157 | + tmp = qemu_get_be32(f); | ||
158 | + env->interrupt_index = tmp; | ||
159 | + qemu_get_be32s(f, &env->pil_in); | ||
150 | #ifndef TARGET_SPARC64 | 160 | #ifndef TARGET_SPARC64 |
151 | qemu_get_be32s(f, &env->wim); | 161 | qemu_get_be32s(f, &env->wim); |
152 | /* MMU */ | 162 | /* MMU */ |