aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davidsaver <mdavidsaver@gmail.com>2015-12-02 19:18:31 -0500
committerPeter Maydell <peter.maydell@linaro.org>2017-01-23 13:33:40 +0000
commit2bf7d0236ff9476414a67004088dc50e33823f8c (patch)
treeff62a93093a3b27acda80abd634875c98f81a71a
parent0aabebf3592f2a3ea762a0b806a60036fdaca749 (diff)
armv7m: additional cpu state for exception handling
Track priorities and highest active and pending exception. Also the highest pending exception for faster exception handler entry. The pending exception information will be re-calculated on load, so no additional vmstate tracking is needed. Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com>
-rw-r--r--target/arm/cpu.c2
-rw-r--r--target/arm/cpu.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 47759c9328..9b1c736819 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -187,6 +187,8 @@ static void arm_cpu_reset(CPUState *s)
uint32_t initial_pc; /* Loaded from 0x4 */
uint8_t *rom;
+ env->v7m.exception_prio = env->v7m.pending_prio = 0x100;
+
env->daif &= ~PSTATE_I;
rom = rom_ptr(0);
if (rom) {
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 521c11b780..473bc30791 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -406,6 +406,9 @@ typedef struct CPUARMState {
uint32_t basepri;
uint32_t control;
int exception;
+ int exception_prio;
+ unsigned pending;
+ int pending_prio;
} v7m;
/* Information associated with an exception about to be taken: