cpu_exec_init() change

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1643 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2005-11-21 23:32:20 +00:00
parent 0e1fd3694e
commit 173d6cfe51
4 changed files with 7 additions and 17 deletions

View File

@ -2199,13 +2199,10 @@ CPUARMState *cpu_arm_init(void)
{ {
CPUARMState *env; CPUARMState *env;
cpu_exec_init(); env = qemu_mallocz(sizeof(CPUARMState));
env = malloc(sizeof(CPUARMState));
if (!env) if (!env)
return NULL; return NULL;
memset(env, 0, sizeof(CPUARMState)); cpu_exec_init(env);
cpu_single_env = env;
return env; return env;
} }

View File

@ -47,12 +47,11 @@ CPUX86State *cpu_x86_init(void)
CPUX86State *env; CPUX86State *env;
static int inited; static int inited;
cpu_exec_init(); env = qemu_mallocz(sizeof(CPUX86State));
env = malloc(sizeof(CPUX86State));
if (!env) if (!env)
return NULL; return NULL;
memset(env, 0, sizeof(CPUX86State)); cpu_exec_init(env);
/* init various static tables */ /* init various static tables */
if (!inited) { if (!inited) {
inited = 1; inited = 1;
@ -135,7 +134,6 @@ CPUX86State *cpu_x86_init(void)
env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA; env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA;
#endif #endif
} }
cpu_single_env = env;
cpu_reset(env); cpu_reset(env);
#ifdef USE_KQEMU #ifdef USE_KQEMU
kqemu_init(env); kqemu_init(env);

View File

@ -1694,10 +1694,10 @@ CPUMIPSState *cpu_mips_init (void)
{ {
CPUMIPSState *env; CPUMIPSState *env;
cpu_exec_init();
env = qemu_mallocz(sizeof(CPUMIPSState)); env = qemu_mallocz(sizeof(CPUMIPSState));
if (!env) if (!env)
return NULL; return NULL;
cpu_exec_init(env);
tlb_flush(env, 1); tlb_flush(env, 1);
/* Minimal init */ /* Minimal init */
env->PC = 0xBFC00000; env->PC = 0xBFC00000;
@ -1722,8 +1722,5 @@ CPUMIPSState *cpu_mips_init (void)
env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER); env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER);
env->CP0_PRid = MIPS_CPU; env->CP0_PRid = MIPS_CPU;
env->exception_index = EXCP_NONE; env->exception_index = EXCP_NONE;
cpu_single_env = env;
return env; return env;
} }

View File

@ -1081,11 +1081,10 @@ CPUPPCState *cpu_ppc_init(void)
{ {
CPUPPCState *env; CPUPPCState *env;
cpu_exec_init();
env = qemu_mallocz(sizeof(CPUPPCState)); env = qemu_mallocz(sizeof(CPUPPCState));
if (!env) if (!env)
return NULL; return NULL;
cpu_exec_init(env);
tlb_flush(env, 1); tlb_flush(env, 1);
#if defined (DO_SINGLE_STEP) && 0 #if defined (DO_SINGLE_STEP) && 0
/* Single step trace mode */ /* Single step trace mode */
@ -1101,7 +1100,6 @@ CPUPPCState *cpu_ppc_init(void)
#endif #endif
do_compute_hflags(env); do_compute_hflags(env);
env->reserve = -1; env->reserve = -1;
cpu_single_env = env;
return env; return env;
} }