armv7m: Extract "exception taken" code into functions
commit39ae2474e337247e5930e8be783b689adc9f6215
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 28 Feb 2017 12:08:18 +0000 (28 12:08 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 28 Feb 2017 12:08:18 +0000 (28 12:08 +0000)
treed287dd2efe1963efd8b4de11d4cbf6ff8fac4a07
parent14790f730a9b7da026f5562505d1004f67abebf5
armv7m: Extract "exception taken" code into functions

Extract the code from the tail end of arm_v7m_do_interrupt() which
enters the exception handler into a pair of utility functions
v7m_exception_taken() and v7m_push_stack(), which correspond roughly
to the pseudocode PushStack() and ExceptionTaken().

This also requires us to move the arm_v7m_load_vector() utility
routine up so we can call it.

Handling illegal exception returns has some cases where we want to
take a UsageFault either on an existing stack frame or with a new
stack frame but with a specific LR value, so we want to be able to
call these without having to go via arm_v7m_cpu_do_interrupt().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
target/arm/helper.c