aboutsummaryrefslogtreecommitdiff
path: root/hw/an5206.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-18 14:10:34 +0100
committerAndreas Färber <afaerber@suse.de>2013-02-16 14:50:59 +0100
commit4025cfd5d7175203008343a375f9287c77cd383c (patch)
tree812788cf080e81b35b976324d2bf71afd14ed8bc /hw/an5206.c
parentc7937d9f9a99d8cc2848e85f608d89c6f326daf0 (diff)
mcf5206: Pass M68kCPU to mcf5206_init()
Store it in m5206_mbar_state. Prepares for passing M68kCPU to m68k_set_irq_level(). Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/an5206.c')
-rw-r--r--hw/an5206.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/an5206.c b/hw/an5206.c
index 750115a3aa..924be81d57 100644
--- a/hw/an5206.c
+++ b/hw/an5206.c
@@ -24,6 +24,7 @@ static void an5206_init(QEMUMachineInitArgs *args)
ram_addr_t ram_size = args->ram_size;
const char *cpu_model = args->cpu_model;
const char *kernel_filename = args->kernel_filename;
+ M68kCPU *cpu;
CPUM68KState *env;
int kernel_size;
uint64_t elf_entry;
@@ -32,12 +33,14 @@ static void an5206_init(QEMUMachineInitArgs *args)
MemoryRegion *ram = g_new(MemoryRegion, 1);
MemoryRegion *sram = g_new(MemoryRegion, 1);
- if (!cpu_model)
+ if (!cpu_model) {
cpu_model = "m5206";
- env = cpu_init(cpu_model);
- if (!env) {
+ }
+ cpu = cpu_m68k_init(cpu_model);
+ if (!cpu) {
hw_error("Unable to find m68k CPU definition\n");
}
+ env = &cpu->env;
/* Initialize CPU registers. */
env->vbr = 0;
@@ -55,7 +58,7 @@ static void an5206_init(QEMUMachineInitArgs *args)
vmstate_register_ram_global(sram);
memory_region_add_subregion(address_space_mem, AN5206_RAMBAR_ADDR, sram);
- mcf5206_init(address_space_mem, AN5206_MBAR_ADDR, env);
+ mcf5206_init(address_space_mem, AN5206_MBAR_ADDR, cpu);
/* Load kernel. */
if (!kernel_filename) {