Commit 01ba98161f954621bcf557ad8d5a0838d18000a1
1 parent
1b66074b
Handle cpu_model in copy_cpu(), by Kirill A. Shutemov.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3778 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
8 changed files
with
12 additions
and
8 deletions
cpu-defs.h
... | ... | @@ -146,6 +146,8 @@ typedef struct CPUTLBEntry { |
146 | 146 | void *next_cpu; /* next CPU sharing TB cache */ \ |
147 | 147 | int cpu_index; /* CPU index (informative) */ \ |
148 | 148 | /* user data */ \ |
149 | - void *opaque; | |
149 | + void *opaque; \ | |
150 | + \ | |
151 | + const char *cpu_model_str; | |
150 | 152 | |
151 | 153 | #endif | ... | ... |
exec.c
... | ... | @@ -1317,9 +1317,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...) |
1317 | 1317 | |
1318 | 1318 | CPUState *cpu_copy(CPUState *env) |
1319 | 1319 | { |
1320 | -#if 0 | |
1321 | - /* XXX: broken, must be handled by each CPU */ | |
1322 | - CPUState *new_env = cpu_init(); | |
1320 | + CPUState *new_env = cpu_init(env->cpu_model_str); | |
1323 | 1321 | /* preserve chaining and index */ |
1324 | 1322 | CPUState *next_cpu = new_env->next_cpu; |
1325 | 1323 | int cpu_index = new_env->cpu_index; |
... | ... | @@ -1327,9 +1325,6 @@ CPUState *cpu_copy(CPUState *env) |
1327 | 1325 | new_env->next_cpu = next_cpu; |
1328 | 1326 | new_env->cpu_index = cpu_index; |
1329 | 1327 | return new_env; |
1330 | -#else | |
1331 | - return NULL; | |
1332 | -#endif | |
1333 | 1328 | } |
1334 | 1329 | |
1335 | 1330 | #if !defined(CONFIG_USER_ONLY) | ... | ... |
target-arm/helper.c
target-i386/helper2.c
target-m68k/helper.c
... | ... | @@ -126,11 +126,13 @@ CPUM68KState *cpu_m68k_init(const char *cpu_model) |
126 | 126 | return NULL; |
127 | 127 | cpu_exec_init(env); |
128 | 128 | |
129 | + env->cpu_model_str = cpu_model; | |
130 | + | |
129 | 131 | if (cpu_m68k_set_model(env, cpu_model) < 0) { |
130 | 132 | cpu_m68k_close(env); |
131 | 133 | return NULL; |
132 | 134 | } |
133 | - | |
135 | + | |
134 | 136 | cpu_reset(env); |
135 | 137 | return env; |
136 | 138 | } | ... | ... |
target-mips/translate.c
target-ppc/helper.c
target-sparc/translate.c
... | ... | @@ -3792,6 +3792,7 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model) |
3792 | 3792 | if (!env) |
3793 | 3793 | return NULL; |
3794 | 3794 | cpu_exec_init(env); |
3795 | + env->cpu_model_str = cpu_model; | |
3795 | 3796 | env->version = def->iu_version; |
3796 | 3797 | env->fsr = def->fpu_version; |
3797 | 3798 | #if !defined(TARGET_SPARC64) | ... | ... |