diff options
Diffstat (limited to 'hw/r2d.c')
-rw-r--r-- | hw/r2d.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -192,16 +192,16 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem, } typedef struct ResetData { - CPUSH4State *env; + SuperHCPU *cpu; uint32_t vector; } ResetData; static void main_cpu_reset(void *opaque) { ResetData *s = (ResetData *)opaque; - CPUSH4State *env = s->env; + CPUSH4State *env = &s->cpu->env; - cpu_state_reset(env); + cpu_reset(CPU(s->cpu)); env->pc = s->vector; } @@ -224,6 +224,7 @@ static void r2d_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { + SuperHCPU *cpu; CPUSH4State *env; ResetData *reset_info; struct SH7750State *s; @@ -235,16 +236,19 @@ static void r2d_init(ram_addr_t ram_size, SysBusDevice *busdev; MemoryRegion *address_space_mem = get_system_memory(); - if (!cpu_model) + if (cpu_model == NULL) { cpu_model = "SH7751R"; + } - env = cpu_init(cpu_model); - if (!env) { + cpu = cpu_sh4_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } + env = &cpu->env; + reset_info = g_malloc0(sizeof(ResetData)); - reset_info->env = env; + reset_info->cpu = cpu; reset_info->vector = env->pc; qemu_register_reset(main_cpu_reset, reset_info); |