Commit 72d239ed26db3f288e73b68b70fcf1bb06f67900
1 parent
1c918eba
Get rid of user_mode_only
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6305 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
7 changed files
with
4 additions
and
12 deletions
bsd-user/main.c
| @@ -558,7 +558,6 @@ int main(int argc, char **argv) | @@ -558,7 +558,6 @@ int main(int argc, char **argv) | ||
| 558 | init_task_state(ts); | 558 | init_task_state(ts); |
| 559 | ts->info = info; | 559 | ts->info = info; |
| 560 | env->opaque = ts; | 560 | env->opaque = ts; |
| 561 | - env->user_mode_only = 1; | ||
| 562 | 561 | ||
| 563 | #if defined(TARGET_SPARC) | 562 | #if defined(TARGET_SPARC) |
| 564 | { | 563 | { |
cpu-defs.h
| @@ -201,8 +201,6 @@ typedef struct CPUWatchpoint { | @@ -201,8 +201,6 @@ typedef struct CPUWatchpoint { | ||
| 201 | jmp_buf jmp_env; \ | 201 | jmp_buf jmp_env; \ |
| 202 | int exception_index; \ | 202 | int exception_index; \ |
| 203 | \ | 203 | \ |
| 204 | - int user_mode_only; \ | ||
| 205 | - \ | ||
| 206 | void *next_cpu; /* next CPU sharing TB cache */ \ | 204 | void *next_cpu; /* next CPU sharing TB cache */ \ |
| 207 | int cpu_index; /* CPU index (informative) */ \ | 205 | int cpu_index; /* CPU index (informative) */ \ |
| 208 | int running; /* Nonzero if cpu is currently running(usermode). */ \ | 206 | int running; /* Nonzero if cpu is currently running(usermode). */ \ |
cpu-exec.c
| @@ -263,7 +263,8 @@ int cpu_exec(CPUState *env1) | @@ -263,7 +263,8 @@ int cpu_exec(CPUState *env1) | ||
| 263 | if (ret == EXCP_DEBUG) | 263 | if (ret == EXCP_DEBUG) |
| 264 | cpu_handle_debug_exception(env); | 264 | cpu_handle_debug_exception(env); |
| 265 | break; | 265 | break; |
| 266 | - } else if (env->user_mode_only) { | 266 | + } else { |
| 267 | +#if defined(CONFIG_USER_ONLY) | ||
| 267 | /* if user mode only, we simulate a fake exception | 268 | /* if user mode only, we simulate a fake exception |
| 268 | which will be handled outside the cpu execution | 269 | which will be handled outside the cpu execution |
| 269 | loop */ | 270 | loop */ |
| @@ -277,7 +278,7 @@ int cpu_exec(CPUState *env1) | @@ -277,7 +278,7 @@ int cpu_exec(CPUState *env1) | ||
| 277 | #endif | 278 | #endif |
| 278 | ret = env->exception_index; | 279 | ret = env->exception_index; |
| 279 | break; | 280 | break; |
| 280 | - } else { | 281 | +#else |
| 281 | #if defined(TARGET_I386) | 282 | #if defined(TARGET_I386) |
| 282 | /* simulate a real cpu exception. On i386, it can | 283 | /* simulate a real cpu exception. On i386, it can |
| 283 | trigger new exceptions, but we do not handle | 284 | trigger new exceptions, but we do not handle |
| @@ -305,6 +306,7 @@ int cpu_exec(CPUState *env1) | @@ -305,6 +306,7 @@ int cpu_exec(CPUState *env1) | ||
| 305 | #elif defined(TARGET_M68K) | 306 | #elif defined(TARGET_M68K) |
| 306 | do_interrupt(0); | 307 | do_interrupt(0); |
| 307 | #endif | 308 | #endif |
| 309 | +#endif | ||
| 308 | } | 310 | } |
| 309 | env->exception_index = -1; | 311 | env->exception_index = -1; |
| 310 | } | 312 | } |
darwin-user/main.c
| @@ -896,7 +896,6 @@ int main(int argc, char **argv) | @@ -896,7 +896,6 @@ int main(int argc, char **argv) | ||
| 896 | memset(ts, 0, sizeof(TaskState)); | 896 | memset(ts, 0, sizeof(TaskState)); |
| 897 | env->opaque = ts; | 897 | env->opaque = ts; |
| 898 | ts->used = 1; | 898 | ts->used = 1; |
| 899 | - env->user_mode_only = 1; | ||
| 900 | 899 | ||
| 901 | #if defined(TARGET_I386) | 900 | #if defined(TARGET_I386) |
| 902 | cpu_x86_set_cpl(env, 3); | 901 | cpu_x86_set_cpl(env, 3); |
linux-user/main.c
| @@ -2421,7 +2421,6 @@ int main(int argc, char **argv, char **envp) | @@ -2421,7 +2421,6 @@ int main(int argc, char **argv, char **envp) | ||
| 2421 | init_task_state(ts); | 2421 | init_task_state(ts); |
| 2422 | ts->info = info; | 2422 | ts->info = info; |
| 2423 | env->opaque = ts; | 2423 | env->opaque = ts; |
| 2424 | - env->user_mode_only = 1; | ||
| 2425 | 2424 | ||
| 2426 | #if defined(TARGET_I386) | 2425 | #if defined(TARGET_I386) |
| 2427 | cpu_x86_set_cpl(env, 3); | 2426 | cpu_x86_set_cpl(env, 3); |
target-sparc/helper.c
| @@ -644,7 +644,6 @@ void cpu_reset(CPUSPARCState *env) | @@ -644,7 +644,6 @@ void cpu_reset(CPUSPARCState *env) | ||
| 644 | env->wim = 1; | 644 | env->wim = 1; |
| 645 | env->regwptr = env->regbase + (env->cwp * 16); | 645 | env->regwptr = env->regbase + (env->cwp * 16); |
| 646 | #if defined(CONFIG_USER_ONLY) | 646 | #if defined(CONFIG_USER_ONLY) |
| 647 | - env->user_mode_only = 1; | ||
| 648 | #ifdef TARGET_SPARC64 | 647 | #ifdef TARGET_SPARC64 |
| 649 | env->cleanwin = env->nwindows - 2; | 648 | env->cleanwin = env->nwindows - 2; |
| 650 | env->cansave = env->nwindows - 2; | 649 | env->cansave = env->nwindows - 2; |
tests/qruncom.c
| @@ -199,10 +199,6 @@ int main(int argc, char **argv) | @@ -199,10 +199,6 @@ int main(int argc, char **argv) | ||
| 199 | 199 | ||
| 200 | env = cpu_init("qemu32"); | 200 | env = cpu_init("qemu32"); |
| 201 | 201 | ||
| 202 | - /* set user mode state (XXX: should be done automatically by | ||
| 203 | - cpu_init ?) */ | ||
| 204 | - env->user_mode_only = 1; | ||
| 205 | - | ||
| 206 | cpu_x86_set_cpl(env, 3); | 202 | cpu_x86_set_cpl(env, 3); |
| 207 | 203 | ||
| 208 | env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK; | 204 | env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK; |