armv7m_nvic: keep a pointer to the CPU
commitd713ea6c464918f87d1dd480520dd4aedb685d9a
authorMichael Davidsaver <mdavidsaver@gmail.com>
Fri, 27 Jan 2017 15:20:22 +0000 (27 15:20 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 27 Jan 2017 15:29:08 +0000 (27 15:29 +0000)
treeafb9f69a6d4bcbf654a0b7c482659a7070745eae
parent531c60a97ab51618b4b9ccef1c5fe00607079706
armv7m_nvic: keep a pointer to the CPU

Many NVIC operations access the CPU state, so store a pointer in
struct nvic_state rather than fetching it via qemu_get_cpu() every
time we need it.

As with the arm_gicv3_common code, we currently just call
qemu_get_cpu() in the NVIC's realize method, but in future we might
want to use a QOM property to pass the CPU to the NVIC.

This imposes an ordering requirement that the CPU is
realized before the NVIC, but that is always true since
both are dealt with in armv7m_init().

Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1485285380-10565-3-git-send-email-peter.maydell@linaro.org
[PMM: Use qemu_get_cpu(0) rather than first_cpu; expand
 commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/armv7m_nvic.c