diff options
author | Andreas Färber <afaerber@suse.de> | 2013-02-02 12:33:14 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-03-12 10:35:55 +0100 |
commit | e6f010cc27177c97596455b2e2b589bd19b2a486 (patch) | |
tree | 43403ce74bd92387e1842af44a21ea3fe31fc172 /target-arm/helper.c | |
parent | 97a8ea5a3ae7938cb54fd4dc19d3a413024bc6c0 (diff) |
target-arm: Override do_interrupt for ARMv7-M profile
Enable ARMCPUInfo to specify a custom class_init functions.
Introduce arm_v7m_class_init() and use it for "cortex-m3" model.
Instead of forwarding from arm_cpu_do_interrupt() to do_interrupt_v7m(),
override CPUClass::do_interrupt with arm_v7m_cpu_do_interrupt()
in arm_v7m_class_init().
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-arm/helper.c')
-rw-r--r-- | target-arm/helper.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c index b4cbb8718a..fd055e89f2 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1725,8 +1725,10 @@ static void do_v7m_exception_exit(CPUARMState *env) pointer. */ } -static void do_interrupt_v7m(CPUARMState *env) +void arm_v7m_cpu_do_interrupt(CPUState *cs) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; uint32_t xpsr = xpsr_read(env); uint32_t lr; uint32_t addr; @@ -1811,10 +1813,8 @@ void arm_cpu_do_interrupt(CPUState *cs) int new_mode; uint32_t offset; - if (IS_M(env)) { - do_interrupt_v7m(env); - return; - } + assert(!IS_M(env)); + /* TODO: Vectored interrupt controller. */ switch (env->exception_index) { case EXCP_UDEF: |