nvic: Handle v8M changes in nvic_exec_prio()
commit49c80c380d665bcc7d5b68ea1ec3617e51a90d73
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 12 Sep 2017 18:14:02 +0000 (12 19:14 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 21 Sep 2017 15:31:09 +0000 (21 16:31 +0100)
tree6ec173d9830f31c0284aa7b410ff4e62023c59d9
parent7208b426c7347982af8f5d6f2608cab6b3431ede
nvic: Handle v8M changes in nvic_exec_prio()

Update nvic_exec_prio() to support the v8M changes:
 * BASEPRI, FAULTMASK and PRIMASK are all banked
 * AIRCR.PRIS can affect NS priorities
 * AIRCR.BFHFNMINS affects FAULTMASK behaviour

These changes mean that it's no longer possible to
definitely say that if FAULTMASK is set it overrides
PRIMASK, and if PRIMASK is set it overrides BASEPRI
(since if PRIMASK_NS is set and AIRCR.PRIS is set then
whether that 0x80 priority should take effect or the
priority in BASEPRI_S depends on the value of BASEPRI_S,
for instance). So we switch to the same approach used
by the pseudocode of working through BASEPRI, PRIMASK
and FAULTMASK and overriding the previous values if
needed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 1505240046-11454-16-git-send-email-peter.maydell@linaro.org
hw/intc/armv7m_nvic.c