mirror of https://github.com/xqemu/xqemu.git
Resynchronize darwin-user target with linux-user:
add CPU selection feature, choose the correct default CPU and set the 32/64 bits computation mode properly. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3657 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
b172c56a6d
commit
31fca6ab60
|
@ -834,6 +834,15 @@ int main(int argc, char **argv)
|
||||||
} else
|
} else
|
||||||
if (!strcmp(r, "g")) {
|
if (!strcmp(r, "g")) {
|
||||||
use_gdbstub = 1;
|
use_gdbstub = 1;
|
||||||
|
} else if (!strcmp(r, "cpu")) {
|
||||||
|
cpu_model = argv[optind++];
|
||||||
|
if (strcmp(cpu_model, "?") == 0) {
|
||||||
|
/* XXX: implement xxx_cpu_list for targets that still miss it */
|
||||||
|
#if defined(cpu_list)
|
||||||
|
cpu_list(stdout, &fprintf);
|
||||||
|
#endif
|
||||||
|
_exit(1);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
usage();
|
usage();
|
||||||
|
@ -846,16 +855,26 @@ int main(int argc, char **argv)
|
||||||
/* Zero out regs */
|
/* Zero out regs */
|
||||||
memset(regs, 0, sizeof(struct target_pt_regs));
|
memset(regs, 0, sizeof(struct target_pt_regs));
|
||||||
|
|
||||||
/* NOTE: we need to init the CPU at this stage to get
|
if (cpu_model == NULL) {
|
||||||
qemu_host_page_size */
|
|
||||||
#if defined(TARGET_I386)
|
#if defined(TARGET_I386)
|
||||||
cpu_model = "qemu32";
|
#ifdef TARGET_X86_64
|
||||||
|
cpu_model = "qemu64";
|
||||||
|
#else
|
||||||
|
cpu_model = "qemu32";
|
||||||
|
#endif
|
||||||
#elif defined(TARGET_PPC)
|
#elif defined(TARGET_PPC)
|
||||||
cpu_model = "750";
|
#ifdef TARGET_PPC64
|
||||||
|
cpu_model = "970";
|
||||||
|
#else
|
||||||
|
cpu_model = "750";
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#error unsupported CPU
|
#error unsupported CPU
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NOTE: we need to init the CPU at this stage to get
|
||||||
|
qemu_host_page_size */
|
||||||
env = cpu_init(cpu_model);
|
env = cpu_init(cpu_model);
|
||||||
|
|
||||||
printf("Starting %s with qemu\n----------------\n", filename);
|
printf("Starting %s with qemu\n----------------\n", filename);
|
||||||
|
@ -997,6 +1016,14 @@ int main(int argc, char **argv)
|
||||||
#elif defined(TARGET_PPC)
|
#elif defined(TARGET_PPC)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#if defined(TARGET_PPC64)
|
||||||
|
#if defined(TARGET_ABI32)
|
||||||
|
env->msr &= ~((target_ulong)1 << MSR_SF);
|
||||||
|
#else
|
||||||
|
env->msr |= (target_ulong)1 << MSR_SF;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
env->nip = regs->nip;
|
env->nip = regs->nip;
|
||||||
for(i = 0; i < 32; i++) {
|
for(i = 0; i < 32; i++) {
|
||||||
env->gpr[i] = regs->gpr[i];
|
env->gpr[i] = regs->gpr[i];
|
||||||
|
|
Loading…
Reference in New Issue