hw/mips/mips_r4k: Fix initialization of MIPS target CPUs

MIPS emulation is now possible after this basic fix. Still a few kinks
to work out, but at least we hit the translation loop.
This commit is contained in:
Lioncash 2018-09-03 17:40:06 -04:00
parent fa8f566635
commit 48d98a76e7
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -22,17 +22,10 @@
#include "hw/boards.h" #include "hw/boards.h"
#include "exec/address-spaces.h" #include "exec/address-spaces.h"
static int mips_r4k_init(struct uc_struct *uc, MachineState *machine) static int mips_r4k_init(struct uc_struct *uc, MachineState *machine)
{ {
#ifdef TARGET_MIPS64 uc->cpu = cpu_create(uc, machine->cpu_type);
const char *cpu_model = MIPS_CPU_TYPE_NAME("R4000");
#else
const char *cpu_model = MIPS_CPU_TYPE_NAME("24Kf");
#endif
const char *cpu_type = parse_cpu_model(uc, cpu_model);
uc->cpu = cpu_create(uc, cpu_type);
if (uc->cpu == NULL) { if (uc->cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n"); fprintf(stderr, "Unable to find CPU definition\n");
return -1; return -1;