Commit 173d6cfe5129301a3a8f2570223aaa47a815f343
1 parent
0e1fd369
cpu_exec_init() change
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1643 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
7 additions
and
17 deletions
target-arm/translate.c
@@ -2199,13 +2199,10 @@ CPUARMState *cpu_arm_init(void) | @@ -2199,13 +2199,10 @@ CPUARMState *cpu_arm_init(void) | ||
2199 | { | 2199 | { |
2200 | CPUARMState *env; | 2200 | CPUARMState *env; |
2201 | 2201 | ||
2202 | - cpu_exec_init(); | ||
2203 | - | ||
2204 | - env = malloc(sizeof(CPUARMState)); | 2202 | + env = qemu_mallocz(sizeof(CPUARMState)); |
2205 | if (!env) | 2203 | if (!env) |
2206 | return NULL; | 2204 | return NULL; |
2207 | - memset(env, 0, sizeof(CPUARMState)); | ||
2208 | - cpu_single_env = env; | 2205 | + cpu_exec_init(env); |
2209 | return env; | 2206 | return env; |
2210 | } | 2207 | } |
2211 | 2208 |
target-i386/helper2.c
@@ -47,12 +47,11 @@ CPUX86State *cpu_x86_init(void) | @@ -47,12 +47,11 @@ CPUX86State *cpu_x86_init(void) | ||
47 | CPUX86State *env; | 47 | CPUX86State *env; |
48 | static int inited; | 48 | static int inited; |
49 | 49 | ||
50 | - cpu_exec_init(); | ||
51 | - | ||
52 | - env = malloc(sizeof(CPUX86State)); | 50 | + env = qemu_mallocz(sizeof(CPUX86State)); |
53 | if (!env) | 51 | if (!env) |
54 | return NULL; | 52 | return NULL; |
55 | - memset(env, 0, sizeof(CPUX86State)); | 53 | + cpu_exec_init(env); |
54 | + | ||
56 | /* init various static tables */ | 55 | /* init various static tables */ |
57 | if (!inited) { | 56 | if (!inited) { |
58 | inited = 1; | 57 | inited = 1; |
@@ -135,7 +134,6 @@ CPUX86State *cpu_x86_init(void) | @@ -135,7 +134,6 @@ CPUX86State *cpu_x86_init(void) | ||
135 | env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA; | 134 | env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA; |
136 | #endif | 135 | #endif |
137 | } | 136 | } |
138 | - cpu_single_env = env; | ||
139 | cpu_reset(env); | 137 | cpu_reset(env); |
140 | #ifdef USE_KQEMU | 138 | #ifdef USE_KQEMU |
141 | kqemu_init(env); | 139 | kqemu_init(env); |
target-mips/translate.c
@@ -1694,10 +1694,10 @@ CPUMIPSState *cpu_mips_init (void) | @@ -1694,10 +1694,10 @@ CPUMIPSState *cpu_mips_init (void) | ||
1694 | { | 1694 | { |
1695 | CPUMIPSState *env; | 1695 | CPUMIPSState *env; |
1696 | 1696 | ||
1697 | - cpu_exec_init(); | ||
1698 | env = qemu_mallocz(sizeof(CPUMIPSState)); | 1697 | env = qemu_mallocz(sizeof(CPUMIPSState)); |
1699 | if (!env) | 1698 | if (!env) |
1700 | return NULL; | 1699 | return NULL; |
1700 | + cpu_exec_init(env); | ||
1701 | tlb_flush(env, 1); | 1701 | tlb_flush(env, 1); |
1702 | /* Minimal init */ | 1702 | /* Minimal init */ |
1703 | env->PC = 0xBFC00000; | 1703 | env->PC = 0xBFC00000; |
@@ -1722,8 +1722,5 @@ CPUMIPSState *cpu_mips_init (void) | @@ -1722,8 +1722,5 @@ CPUMIPSState *cpu_mips_init (void) | ||
1722 | env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER); | 1722 | env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER); |
1723 | env->CP0_PRid = MIPS_CPU; | 1723 | env->CP0_PRid = MIPS_CPU; |
1724 | env->exception_index = EXCP_NONE; | 1724 | env->exception_index = EXCP_NONE; |
1725 | - | ||
1726 | - cpu_single_env = env; | ||
1727 | - | ||
1728 | return env; | 1725 | return env; |
1729 | } | 1726 | } |
target-ppc/translate_init.c
@@ -1081,11 +1081,10 @@ CPUPPCState *cpu_ppc_init(void) | @@ -1081,11 +1081,10 @@ CPUPPCState *cpu_ppc_init(void) | ||
1081 | { | 1081 | { |
1082 | CPUPPCState *env; | 1082 | CPUPPCState *env; |
1083 | 1083 | ||
1084 | - cpu_exec_init(); | ||
1085 | - | ||
1086 | env = qemu_mallocz(sizeof(CPUPPCState)); | 1084 | env = qemu_mallocz(sizeof(CPUPPCState)); |
1087 | if (!env) | 1085 | if (!env) |
1088 | return NULL; | 1086 | return NULL; |
1087 | + cpu_exec_init(env); | ||
1089 | tlb_flush(env, 1); | 1088 | tlb_flush(env, 1); |
1090 | #if defined (DO_SINGLE_STEP) && 0 | 1089 | #if defined (DO_SINGLE_STEP) && 0 |
1091 | /* Single step trace mode */ | 1090 | /* Single step trace mode */ |
@@ -1101,7 +1100,6 @@ CPUPPCState *cpu_ppc_init(void) | @@ -1101,7 +1100,6 @@ CPUPPCState *cpu_ppc_init(void) | ||
1101 | #endif | 1100 | #endif |
1102 | do_compute_hflags(env); | 1101 | do_compute_hflags(env); |
1103 | env->reserve = -1; | 1102 | env->reserve = -1; |
1104 | - cpu_single_env = env; | ||
1105 | return env; | 1103 | return env; |
1106 | } | 1104 | } |
1107 | 1105 |