diff options
author | Andreas Färber <afaerber@suse.de> | 2012-05-03 03:29:49 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-04 23:00:45 +0200 |
commit | 8ebdf9dcc6036171a9f8bac3fe8dc459725a3e83 (patch) | |
tree | 440b6a98561db4058871f39e7e5f691044265c0a /hw | |
parent | 5414dec6353b24b22480798f08ddc0f110fcbb7f (diff) |
sun4u: Use cpu_sparc_init() to obtain SPARCCPU
This prepares using it in sun4uv_init().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/sun4u.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c index 517bdb818d..92b616fe36 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -754,6 +754,7 @@ static TypeInfo ram_info = { static CPUSPARCState *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef) { + SPARCCPU *cpu; CPUSPARCState *env; ResetData *reset_info; @@ -761,13 +762,15 @@ static CPUSPARCState *cpu_devinit(const char *cpu_model, const struct hwdef *hwd uint32_t stick_frequency = 100*1000000; uint32_t hstick_frequency = 100*1000000; - if (!cpu_model) + if (cpu_model == NULL) { cpu_model = hwdef->default_cpu_model; - env = cpu_init(cpu_model); - if (!env) { + } + cpu = cpu_sparc_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "Unable to find Sparc CPU definition\n"); exit(1); } + env = &cpu->env; env->tick = cpu_timer_create("tick", env, tick_irq, tick_frequency, TICK_NPT_MASK); |