[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/19] nvic: Add cached vectpending_is_s_banked stat
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 03/19] nvic: Add cached vectpending_is_s_banked state |
Date: |
Tue, 12 Sep 2017 19:13:50 +0100 |
With banked exceptions, just the exception number in
s->vectpending is no longer sufficient to uniquely identify
the pending exception. Add a vectpending_is_s_banked bool
which is true if the exception is using the sec_vectors[]
array.
Signed-off-by: Peter Maydell <address@hidden>
---
include/hw/intc/armv7m_nvic.h | 11 +++++++++--
hw/intc/armv7m_nvic.c | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h
index 317601e..87c78b3 100644
--- a/include/hw/intc/armv7m_nvic.h
+++ b/include/hw/intc/armv7m_nvic.h
@@ -57,10 +57,17 @@ typedef struct NVICState {
VecInfo sec_vectors[NVIC_INTERNAL_VECTORS];
uint32_t prigroup;
- /* vectpending and exception_prio are both cached state that can
- * be recalculated from the vectors[] array and the prigroup field.
+ /* The following fields are all cached state that can be recalculated
+ * from the vectors[] and sec_vectors[] arrays and the prigroup field:
+ * - vectpending
+ * - vectpending_is_secure
+ * - exception_prio
*/
unsigned int vectpending; /* highest prio pending enabled exception */
+ /* true if vectpending is a banked secure exception, ie it is in
+ * sec_vectors[] rather than vectors[]
+ */
+ bool vectpending_is_s_banked;
int exception_prio; /* group prio of the highest prio active exception */
MemoryRegion sysregmem;
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 694b9e0..417a456 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -1250,6 +1250,7 @@ static void armv7m_nvic_reset(DeviceState *dev)
s->exception_prio = NVIC_NOEXC_PRIO;
s->vectpending = 0;
+ s->vectpending_is_s_banked = false;
}
static void nvic_systick_trigger(void *opaque, int n, int level)
--
2.7.4
- [Qemu-devel] [PATCH 00/19] ARMv8M: support security extn in the NVIC, Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 02/19] nvic: Add banked exception states, Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 04/19] nvic: Add cached vectpending_prio state, Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 03/19] nvic: Add cached vectpending_is_s_banked state,
Peter Maydell <=
- [Qemu-devel] [PATCH 06/19] nvic: Make ICSR.RETTOBASE handle banked exceptions, Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 11/19] nvic: Compare group priority for escalation to HF, Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 08/19] nvic: Handle banked exceptions in nvic_recompute_state(), Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 16/19] target/arm: Handle banking in negative-execution-priority check in cpu_mmu_index(), Peter Maydell, 2017/09/12
- [Qemu-devel] [PATCH 05/19] nvic: Implement AIRCR changes for v8M, Peter Maydell, 2017/09/12