mirror of https://github.com/xqemu/xqemu.git
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
This commit is contained in:
parent
1b66074b2f
commit
01ba98161f
|
@ -146,6 +146,8 @@ typedef struct CPUTLBEntry {
|
||||||
void *next_cpu; /* next CPU sharing TB cache */ \
|
void *next_cpu; /* next CPU sharing TB cache */ \
|
||||||
int cpu_index; /* CPU index (informative) */ \
|
int cpu_index; /* CPU index (informative) */ \
|
||||||
/* user data */ \
|
/* user data */ \
|
||||||
void *opaque;
|
void *opaque; \
|
||||||
|
\
|
||||||
|
const char *cpu_model_str;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
7
exec.c
7
exec.c
|
@ -1317,9 +1317,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
|
||||||
|
|
||||||
CPUState *cpu_copy(CPUState *env)
|
CPUState *cpu_copy(CPUState *env)
|
||||||
{
|
{
|
||||||
#if 0
|
CPUState *new_env = cpu_init(env->cpu_model_str);
|
||||||
/* XXX: broken, must be handled by each CPU */
|
|
||||||
CPUState *new_env = cpu_init();
|
|
||||||
/* preserve chaining and index */
|
/* preserve chaining and index */
|
||||||
CPUState *next_cpu = new_env->next_cpu;
|
CPUState *next_cpu = new_env->next_cpu;
|
||||||
int cpu_index = new_env->cpu_index;
|
int cpu_index = new_env->cpu_index;
|
||||||
|
@ -1327,9 +1325,6 @@ CPUState *cpu_copy(CPUState *env)
|
||||||
new_env->next_cpu = next_cpu;
|
new_env->next_cpu = next_cpu;
|
||||||
new_env->cpu_index = cpu_index;
|
new_env->cpu_index = cpu_index;
|
||||||
return new_env;
|
return new_env;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
|
|
@ -182,6 +182,7 @@ CPUARMState *cpu_arm_init(const char *cpu_model)
|
||||||
if (!env)
|
if (!env)
|
||||||
return NULL;
|
return NULL;
|
||||||
cpu_exec_init(env);
|
cpu_exec_init(env);
|
||||||
|
env->cpu_model_str = cpu_model;
|
||||||
env->cp15.c0_cpuid = id;
|
env->cp15.c0_cpuid = id;
|
||||||
cpu_reset(env);
|
cpu_reset(env);
|
||||||
return env;
|
return env;
|
||||||
|
|
|
@ -99,6 +99,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
|
||||||
if (!env)
|
if (!env)
|
||||||
return NULL;
|
return NULL;
|
||||||
cpu_exec_init(env);
|
cpu_exec_init(env);
|
||||||
|
env->cpu_model_str = cpu_model;
|
||||||
|
|
||||||
/* init various static tables */
|
/* init various static tables */
|
||||||
if (!inited) {
|
if (!inited) {
|
||||||
|
|
|
@ -126,6 +126,8 @@ CPUM68KState *cpu_m68k_init(const char *cpu_model)
|
||||||
return NULL;
|
return NULL;
|
||||||
cpu_exec_init(env);
|
cpu_exec_init(env);
|
||||||
|
|
||||||
|
env->cpu_model_str = cpu_model;
|
||||||
|
|
||||||
if (cpu_m68k_set_model(env, cpu_model) < 0) {
|
if (cpu_m68k_set_model(env, cpu_model) < 0) {
|
||||||
cpu_m68k_close(env);
|
cpu_m68k_close(env);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -6786,6 +6786,7 @@ CPUMIPSState *cpu_mips_init (const char *cpu_model)
|
||||||
env->cpu_model = def;
|
env->cpu_model = def;
|
||||||
|
|
||||||
cpu_exec_init(env);
|
cpu_exec_init(env);
|
||||||
|
env->cpu_model_str = cpu_model;
|
||||||
cpu_reset(env);
|
cpu_reset(env);
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2976,6 +2976,7 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model)
|
||||||
if (!env)
|
if (!env)
|
||||||
return NULL;
|
return NULL;
|
||||||
cpu_exec_init(env);
|
cpu_exec_init(env);
|
||||||
|
env->cpu_model_str = cpu_model;
|
||||||
cpu_ppc_register_internal(env, def);
|
cpu_ppc_register_internal(env, def);
|
||||||
cpu_ppc_reset(env);
|
cpu_ppc_reset(env);
|
||||||
return env;
|
return env;
|
||||||
|
|
|
@ -3792,6 +3792,7 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model)
|
||||||
if (!env)
|
if (!env)
|
||||||
return NULL;
|
return NULL;
|
||||||
cpu_exec_init(env);
|
cpu_exec_init(env);
|
||||||
|
env->cpu_model_str = cpu_model;
|
||||||
env->version = def->iu_version;
|
env->version = def->iu_version;
|
||||||
env->fsr = def->fpu_version;
|
env->fsr = def->fpu_version;
|
||||||
#if !defined(TARGET_SPARC64)
|
#if !defined(TARGET_SPARC64)
|
||||||
|
|
Loading…
Reference in New Issue