summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>2015-06-23 20:19:23 -0700
committerAndreas Färber <afaerber@suse.de>2015-07-09 15:20:40 +0200
commit691b9572e337f2d74b4b527c3dc76f542c6a5734 (patch)
tree52e7627ccb6c265c677b8250c114d5c80b9524cf
parent4df81c6ed1eddcbbb920a977e76f599e05b39b77 (diff)
microblaze: boot: Use cpu_set_pc()
Use cpu_set_pc() for setting program counters when bootloading. This removes an instance of system level code having to reach into the CPU env. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> [AF: Avoid duplicated CPU() casts through local variable] Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--hw/microblaze/boot.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 4c44317b65..3e8820f365 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -48,13 +48,14 @@ static struct
static void main_cpu_reset(void *opaque)
{
MicroBlazeCPU *cpu = opaque;
+ CPUState *cs = CPU(cpu);
CPUMBState *env = &cpu->env;
- cpu_reset(CPU(cpu));
+ cpu_reset(cs);
env->regs[5] = boot_info.cmdline;
env->regs[6] = boot_info.initrd_start;
env->regs[7] = boot_info.fdt;
- env->sregs[SR_PC] = boot_info.bootstrap_pc;
+ cpu_set_pc(cs, boot_info.bootstrap_pc);
if (boot_info.machine_cpu_reset) {
boot_info.machine_cpu_reset(cpu);
}