Patchwork [qom-next,39/59] target-ppc: Pass PowerPCCPU to cpu_ppc_hypercall

login
register
mail settings
Submitter Andreas Färber
Date May 23, 2012, 3:08 a.m.
Message ID <1337742502-28565-40-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/160817/
State New
Headers show

Comments

Andreas Färber - May 23, 2012, 3:08 a.m.
Adapt emulate_spapr_hypercall() accordingly.

Needed for spapr_hypercall().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/spapr.c          |    4 +++-
 target-ppc/cpu.h    |    2 +-
 target-ppc/helper.c |    4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/hw/spapr.c b/hw/spapr.c
index d0bddbc..70068b4 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -477,8 +477,10 @@  static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
     return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR;
 }
 
-static void emulate_spapr_hypercall(CPUPPCState *env)
+static void emulate_spapr_hypercall(PowerPCCPU *cpu)
 {
+    CPUPPCState *env = &cpu->env;
+
     env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]);
 }
 
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 77a2858..9b38529 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -2182,7 +2182,7 @@  static inline uint32_t booke206_tlbnps(CPUPPCState *env, const int tlbn)
 
 #endif
 
-extern void (*cpu_ppc_hypercall)(CPUPPCState *);
+extern void (*cpu_ppc_hypercall)(PowerPCCPU *);
 
 static inline bool cpu_has_work(CPUPPCState *env)
 {
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index f947684..7747674 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -67,7 +67,7 @@ 
 /*****************************************************************************/
 /* PowerPC Hypercall emulation */
 
-void (*cpu_ppc_hypercall)(CPUPPCState *);
+void (*cpu_ppc_hypercall)(PowerPCCPU *);
 
 /*****************************************************************************/
 /* PowerPC MMU emulation */
@@ -2674,7 +2674,7 @@  static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
         dump_syscall(env);
         lev = env->error_code;
         if ((lev == 1) && cpu_ppc_hypercall) {
-            cpu_ppc_hypercall(env);
+            cpu_ppc_hypercall(cpu);
             return;
         }
         if (lev == 1 || (lpes0 == 0 && lpes1 == 0))