mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 03:13:44 +08:00
target-ppc: Use cpu_exec_interrupt qom hook
Cc: qemu-ppc@nongnu.org Signed-off-by: Richard Henderson <rth@twiddle.net> Message-id: 1410626734-3804-22-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
e9854c3945
commit
458dd76656
@ -490,14 +490,6 @@ int cpu_exec(CPUArchState *env)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#elif defined(TARGET_PPC)
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD) {
|
||||
ppc_hw_interrupt(env);
|
||||
if (env->pending_interrupts == 0) {
|
||||
cpu->interrupt_request &= ~CPU_INTERRUPT_HARD;
|
||||
}
|
||||
next_tb = 0;
|
||||
}
|
||||
#endif
|
||||
/* The target hook has 3 exit conditions:
|
||||
False when the interrupt isn't processed,
|
||||
|
@ -113,6 +113,7 @@ PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr);
|
||||
PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr);
|
||||
|
||||
void ppc_cpu_do_interrupt(CPUState *cpu);
|
||||
bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
|
||||
void ppc_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
void ppc_cpu_dump_statistics(CPUState *cpu, FILE *f,
|
||||
|
@ -1147,7 +1147,6 @@ int cpu_ppc_exec (CPUPPCState *s);
|
||||
is returned if the signal was handled by the virtual CPU. */
|
||||
int cpu_ppc_signal_handler (int host_signum, void *pinfo,
|
||||
void *puc);
|
||||
void ppc_hw_interrupt (CPUPPCState *env);
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
int ppc_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
|
||||
int mmu_idx);
|
||||
|
@ -48,7 +48,7 @@ void ppc_cpu_do_interrupt(CPUState *cs)
|
||||
env->error_code = 0;
|
||||
}
|
||||
|
||||
void ppc_hw_interrupt(CPUPPCState *env)
|
||||
static void ppc_hw_interrupt(CPUPPCState *env)
|
||||
{
|
||||
CPUState *cs = CPU(ppc_env_get_cpu(env));
|
||||
|
||||
@ -692,7 +692,7 @@ void ppc_cpu_do_interrupt(CPUState *cs)
|
||||
powerpc_excp(cpu, env->excp_model, cs->exception_index);
|
||||
}
|
||||
|
||||
void ppc_hw_interrupt(CPUPPCState *env)
|
||||
static void ppc_hw_interrupt(CPUPPCState *env)
|
||||
{
|
||||
PowerPCCPU *cpu = ppc_env_get_cpu(env);
|
||||
int hdice;
|
||||
@ -820,6 +820,21 @@ void ppc_cpu_do_system_reset(CPUState *cs)
|
||||
}
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
bool ppc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
|
||||
if (interrupt_request & CPU_INTERRUPT_HARD) {
|
||||
ppc_hw_interrupt(env);
|
||||
if (env->pending_interrupts == 0) {
|
||||
cs->interrupt_request &= ~CPU_INTERRUPT_HARD;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(DEBUG_OP)
|
||||
static void cpu_dump_rfi(target_ulong RA, target_ulong msr)
|
||||
{
|
||||
|
@ -9631,6 +9631,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
|
||||
cc->class_by_name = ppc_cpu_class_by_name;
|
||||
cc->has_work = ppc_cpu_has_work;
|
||||
cc->do_interrupt = ppc_cpu_do_interrupt;
|
||||
cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt;
|
||||
cc->dump_state = ppc_cpu_dump_state;
|
||||
cc->dump_statistics = ppc_cpu_dump_statistics;
|
||||
cc->set_pc = ppc_cpu_set_pc;
|
||||
|
Loading…
Reference in New Issue
Block a user