]> Git Repo - qemu.git/commitdiff
nvic: Compare group priority for escalation to HF
authorPeter Maydell <[email protected]>
Tue, 12 Sep 2017 18:13:58 +0000 (19:13 +0100)
committerPeter Maydell <[email protected]>
Thu, 21 Sep 2017 15:31:09 +0000 (16:31 +0100)
In armv7m_nvic_set_pending() we have to compare the
priority of an exception against the execution priority
to decide whether it needs to be escalated to HardFault.
In the specification this is a comparison against the
exception's group priority; for v7M we implemented it
as a comparison against the raw exception priority
because the two comparisons will always give the
same answer. For v8M the existence of AIRCR.PRIS and
the possibility of different PRIGROUP values for secure
and nonsecure exceptions means we need to explicitly
calculate the vector's group priority for this check.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 1505240046[email protected]

hw/intc/armv7m_nvic.c

index 6831ec5ae8a21a3b243cbf56c0516ff88aa545f4..d4b410d908fe17c1b14bf83f4d40410aa23ed2a1 100644 (file)
@@ -478,7 +478,7 @@ void armv7m_nvic_set_pending(void *opaque, int irq, bool secure)
         int running = nvic_exec_prio(s);
         bool escalate = false;
 
-        if (vec->prio >= running) {
+        if (exc_group_prio(s, vec->prio, secure) >= running) {
             trace_nvic_escalate_prio(irq, vec->prio, running);
             escalate = true;
         } else if (!vec->enabled) {
This page took 0.029826 seconds and 4 git commands to generate.