@@ -692,6 +692,8 @@ struct CPUPPCState {
int bfd_mach;
uint32_t flags;
uint64_t insns_flags;
+ void (*emulate_hypercall)(CPUState *, void *);
+ void *hcall_opaque;
int error_code;
uint32_t pending_interrupts;
@@ -2152,6 +2152,10 @@ static inline void powerpc_excp(CPUState *env, int excp_model, int excp)
case POWERPC_EXCP_SYSCALL: /* System call exception */
dump_syscall(env);
lev = env->error_code;
+ if ((lev == 1) && env->emulate_hypercall) {
+ env->emulate_hypercall(env, env->hcall_opaque);
+ return;
+ }
if (lev == 1 || (lpes0 == 0 && lpes1 == 0))
new_msr |= (target_ulong)MSR_HVB;
goto store_next;