diff options
author | Andreas Färber <afaerber@suse.de> | 2013-08-25 18:53:55 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-03-13 19:01:49 +0100 |
commit | 8c2e1b0093aa4a89548df47d969217d8b0dfd070 (patch) | |
tree | 16656127c1a0c6194b25f29bd54f612b9c1f8679 /target-arm | |
parent | 1cf5ccbca8915277098727d900d52c495a711f88 (diff) |
cpu: Turn cpu_has_work() into a CPUClass hook
Default to false.
Tidy variable naming and inline cast uses while at it.
Tested-by: Jia Liu <proljc@gmail.com> (or32)
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-arm')
-rw-r--r-- | target-arm/cpu.c | 7 | ||||
-rw-r--r-- | target-arm/cpu.h | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 1ce8a9bc38..d792a912e7 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -36,6 +36,12 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.regs[15] = value; } +static bool arm_cpu_has_work(CPUState *cs) +{ + return cs->interrupt_request & + (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); +} + static void cp_reg_reset(gpointer key, gpointer value, gpointer opaque) { /* Reset a single ARMCPRegInfo register */ @@ -1001,6 +1007,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->reset = arm_cpu_reset; cc->class_by_name = arm_cpu_class_by_name; + cc->has_work = arm_cpu_has_work; cc->do_interrupt = arm_cpu_do_interrupt; cc->dump_state = arm_cpu_dump_state; cc->set_pc = arm_cpu_set_pc; diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 0a7edfe6cb..00d91d1231 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1166,12 +1166,6 @@ static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, *cs_base = 0; } -static inline bool cpu_has_work(CPUState *cpu) -{ - return cpu->interrupt_request & - (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); -} - #include "exec/exec-all.h" static inline void cpu_pc_from_tb(CPUARMState *env, TranslationBlock *tb) |