qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL v2 15/22] microblaze: boot: Use cpu_set_pc()


From: Andreas Färber
Subject: [Qemu-devel] [PULL v2 15/22] microblaze: boot: Use cpu_set_pc()
Date: Tue, 7 Jul 2015 19:16:22 +0200

From: Peter Crosthwaite <address@hidden>

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 <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
[AF: Avoid duplicated CPU() casts through local variable]
Signed-off-by: Andreas Färber <address@hidden>
---
 hw/microblaze/boot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 4c44317..3e8820f 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);
     }
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]