Commit 925fb139be707fe637bdadb25138c72efcf333b5
1 parent
1c6e9070
Sparc32/64 CPU selection for user emulator
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2637 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
16 additions
and
0 deletions
linux-user/main.c
... | ... | @@ -1745,6 +1745,8 @@ int main(int argc, char **argv) |
1745 | 1745 | arm_cpu_list(); |
1746 | 1746 | #elif defined(TARGET_MIPS) |
1747 | 1747 | mips_cpu_list(stdout, &fprintf); |
1748 | +#elif defined(TARGET_SPARC) | |
1749 | + sparc_cpu_list(stdout, &fprintf); | |
1748 | 1750 | #endif |
1749 | 1751 | _exit(1); |
1750 | 1752 | } |
... | ... | @@ -1900,6 +1902,20 @@ int main(int argc, char **argv) |
1900 | 1902 | #elif defined(TARGET_SPARC) |
1901 | 1903 | { |
1902 | 1904 | int i; |
1905 | + const sparc_def_t *def; | |
1906 | +#ifdef TARGET_SPARC64 | |
1907 | + if (cpu_model == NULL) | |
1908 | + cpu_model = "TI UltraSparc II"; | |
1909 | +#else | |
1910 | + if (cpu_model == NULL) | |
1911 | + cpu_model = "Fujitsu MB86904"; | |
1912 | +#endif | |
1913 | + sparc_find_by_name(cpu_model, &def); | |
1914 | + if (def == NULL) { | |
1915 | + fprintf(stderr, "Unable to find Sparc CPU definition\n"); | |
1916 | + exit(1); | |
1917 | + } | |
1918 | + cpu_sparc_register(env, def); | |
1903 | 1919 | env->pc = regs->pc; |
1904 | 1920 | env->npc = regs->npc; |
1905 | 1921 | env->y = regs->y; | ... | ... |