mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
r2d: Use cpu_sh4_init() to obtain SuperHCPU
Needed for main_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
445e957194
commit
fd2f410b37
1 changed files with 7 additions and 3 deletions
10
hw/r2d.c
10
hw/r2d.c
|
@ -224,6 +224,7 @@ static void r2d_init(ram_addr_t ram_size,
|
||||||
const char *kernel_filename, const char *kernel_cmdline,
|
const char *kernel_filename, const char *kernel_cmdline,
|
||||||
const char *initrd_filename, const char *cpu_model)
|
const char *initrd_filename, const char *cpu_model)
|
||||||
{
|
{
|
||||||
|
SuperHCPU *cpu;
|
||||||
CPUSH4State *env;
|
CPUSH4State *env;
|
||||||
ResetData *reset_info;
|
ResetData *reset_info;
|
||||||
struct SH7750State *s;
|
struct SH7750State *s;
|
||||||
|
@ -235,14 +236,17 @@ static void r2d_init(ram_addr_t ram_size,
|
||||||
SysBusDevice *busdev;
|
SysBusDevice *busdev;
|
||||||
MemoryRegion *address_space_mem = get_system_memory();
|
MemoryRegion *address_space_mem = get_system_memory();
|
||||||
|
|
||||||
if (!cpu_model)
|
if (cpu_model == NULL) {
|
||||||
cpu_model = "SH7751R";
|
cpu_model = "SH7751R";
|
||||||
|
}
|
||||||
|
|
||||||
env = cpu_init(cpu_model);
|
cpu = cpu_sh4_init(cpu_model);
|
||||||
if (!env) {
|
if (cpu == NULL) {
|
||||||
fprintf(stderr, "Unable to find CPU definition\n");
|
fprintf(stderr, "Unable to find CPU definition\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
env = &cpu->env;
|
||||||
|
|
||||||
reset_info = g_malloc0(sizeof(ResetData));
|
reset_info = g_malloc0(sizeof(ResetData));
|
||||||
reset_info->env = env;
|
reset_info->env = env;
|
||||||
reset_info->vector = env->pc;
|
reset_info->vector = env->pc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue