diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-19 12:16:29 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-19 12:16:29 +0000 |
commit | cff4cbedc3ae945442034970c828f4a631fedcab (patch) | |
tree | 449f041af15a593ba16c178a9288f11422479012 /linux-user | |
parent | b1f9be3157368392b62d5c4213413d5adddd015b (diff) |
Support -cpu selection for mips usermode emulation. Fix segfault when
dispaying the -cpu list help.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2497 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/main.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index b5a0247c4f..0c5e6b5b43 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1644,7 +1644,7 @@ int main(int argc, char **argv) #elif defined(TARGET_MIPS) mips_cpu_list(stdout, &fprintf); #endif - exit(1); + _exit(1); } } else #ifdef USE_CODE_COPY @@ -1849,9 +1849,17 @@ int main(int argc, char **argv) } #elif defined(TARGET_MIPS) { + mips_def_t *def; int i; - /* XXX: set CPU model */ + /* Choose and initialise CPU */ + if (cpu_model == NULL) + cpu_model = "24Kf"; + mips_find_by_name(cpu_model, &def); + if (def == NULL) + cpu_abort(env, "Unable to find MIPS CPU definition\n"); + cpu_mips_register(env, def); + for(i = 0; i < 32; i++) { env->gpr[i] = regs->regs[i]; } |