diff options
author | Andreas Färber <afaerber@suse.de> | 2013-02-18 19:59:39 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-04-16 02:45:11 +0200 |
commit | b21bfeead284cf212d88dfa25171fee122407bc2 (patch) | |
tree | f8f2f7897d9dcf6201c7b337af39938b32453ab0 /target-cris/helper.c | |
parent | a7ddba527c0b9dd32dfa7e35fa41701f990a3db4 (diff) |
target-cris: Override do_interrupt for pre-v32 CPU cores
Instead of forwarding from cris_cpu_do_interrupt() to do_interruptv10(),
override CPUClass::do_interrupt with crisv10_cpu_do_interrupt() in the
newly introduced class_init functions.
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-cris/helper.c')
-rw-r--r-- | target-cris/helper.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/target-cris/helper.c b/target-cris/helper.c index e1ef7bcc0b..466cc2f9d5 100644 --- a/target-cris/helper.c +++ b/target-cris/helper.c @@ -45,6 +45,11 @@ void cris_cpu_do_interrupt(CPUState *cs) env->pregs[PR_ERP] = env->pc; } +void crisv10_cpu_do_interrupt(CPUState *cs) +{ + cris_cpu_do_interrupt(cs); +} + int cpu_cris_handle_mmu_fault(CPUCRISState * env, target_ulong address, int rw, int mmu_idx) { @@ -109,9 +114,10 @@ int cpu_cris_handle_mmu_fault(CPUCRISState *env, target_ulong address, int rw, return r; } -static void do_interruptv10(CPUCRISState *env) +void crisv10_cpu_do_interrupt(CPUState *cs) { - D(CPUState *cs = CPU(cris_env_get_cpu(env))); + CRISCPU *cpu = CRIS_CPU(cs); + CPUCRISState *env = &cpu->env; int ex_vec = -1; D_LOG("exception index=%d interrupt_req=%d\n", @@ -171,10 +177,6 @@ void cris_cpu_do_interrupt(CPUState *cs) CPUCRISState *env = &cpu->env; int ex_vec = -1; - if (env->pregs[PR_VR] < 32) { - return do_interruptv10(env); - } - D_LOG("exception index=%d interrupt_req=%d\n", env->exception_index, cs->interrupt_request); |