Commit cff4cbedc3ae945442034970c828f4a631fedcab

Authored by ths
1 parent b1f9be31

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
Showing 1 changed file with 10 additions and 2 deletions
linux-user/main.c
... ... @@ -1644,7 +1644,7 @@ int main(int argc, char **argv)
1644 1644 #elif defined(TARGET_MIPS)
1645 1645 mips_cpu_list(stdout, &fprintf);
1646 1646 #endif
1647   - exit(1);
  1647 + _exit(1);
1648 1648 }
1649 1649 } else
1650 1650 #ifdef USE_CODE_COPY
... ... @@ -1849,9 +1849,17 @@ int main(int argc, char **argv)
1849 1849 }
1850 1850 #elif defined(TARGET_MIPS)
1851 1851 {
  1852 + mips_def_t *def;
1852 1853 int i;
1853 1854  
1854   - /* XXX: set CPU model */
  1855 + /* Choose and initialise CPU */
  1856 + if (cpu_model == NULL)
  1857 + cpu_model = "24Kf";
  1858 + mips_find_by_name(cpu_model, &def);
  1859 + if (def == NULL)
  1860 + cpu_abort(env, "Unable to find MIPS CPU definition\n");
  1861 + cpu_mips_register(env, def);
  1862 +
1855 1863 for(i = 0; i < 32; i++) {
1856 1864 env->gpr[i] = regs->regs[i];
1857 1865 }
... ...