aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-04 18:38:01 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-04 23:00:43 +0200
commitfd2f410b375a3813b827633c79c2c45ab9e7089a (patch)
tree699aed36f9e0f363643035fe0c820bbd08d96666
parent445e957194807aa9eb1d02c23430dbb0c6bac34e (diff)
r2d: Use cpu_sh4_init() to obtain SuperHCPU
Needed for main_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--hw/r2d.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/r2d.c b/hw/r2d.c
index c55de0141b..1bd8df6d30 100644
--- a/hw/r2d.c
+++ b/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 *initrd_filename, const char *cpu_model)
{
+ SuperHCPU *cpu;
CPUSH4State *env;
ResetData *reset_info;
struct SH7750State *s;
@@ -235,14 +236,17 @@ 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->vector = env->pc;