aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-08-03 20:34:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-08-03 20:34:26 +0100
commit5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10 (patch)
treec4d5d792312b99073390774f2a4dd7e6def1e1f7 /include
parent45a150aa2b3492acf6691c7bdbeb25a8545d8345 (diff)
parent13557fd392890cbd985bceba7f717e01efd674b8 (diff)
downloadqemu-5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10.zip
qemu-5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10.tar.gz
qemu-5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10.tar.bz2
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200803' into staging
target-arm queue: * hw/timer/imx_epit: Avoid assertion when CR.SWR is written * netduino2, netduinoplus2, microbit: set system_clock_scale so that SysTick running on the CPU clock works * target/arm: Avoid maybe-uninitialized warning with gcc 4.9 * target/arm: Fix AddPAC error indication * Make AIRCR.SYSRESETREQ actually reset the system for the microbit, mps2-*, musca-*, netduino* boards # gpg: Signature made Mon 03 Aug 2020 20:29:17 BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20200803: hw/timer/imx_epit: Avoid assertion when CR.SWR is written hw/arm/nrf51_soc: Set system_clock_scale target/arm: Avoid maybe-uninitialized warning with gcc 4.9 target/arm: Fix AddPAC error indication msf2-soc, stellaris: Don't wire up SYSRESETREQ hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ include/hw/irq.h: New function qemu_irq_is_connected() hw/arm/netduino2, netduinoplus2: Set system_clock_scale Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/arm/armv7m.h4
-rw-r--r--include/hw/irq.h18
2 files changed, 21 insertions, 1 deletions
diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h
index d2c74d3..a30e3c6 100644
--- a/include/hw/arm/armv7m.h
+++ b/include/hw/arm/armv7m.h
@@ -35,7 +35,9 @@ typedef struct {
/* ARMv7M container object.
* + Unnamed GPIO input lines: external IRQ lines for the NVIC
- * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ
+ * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ.
+ * If this GPIO is not wired up then the NVIC will default to performing
+ * a qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET).
* + Property "cpu-type": CPU type to instantiate
* + Property "num-irq": number of external IRQ lines
* + Property "memory": MemoryRegion defining the physical address space
diff --git a/include/hw/irq.h b/include/hw/irq.h
index 24ba0ec..dc7abf1 100644
--- a/include/hw/irq.h
+++ b/include/hw/irq.h
@@ -55,4 +55,22 @@ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2);
on an existing vector of qemu_irq. */
void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n);
+/**
+ * qemu_irq_is_connected: Return true if IRQ line is wired up
+ *
+ * If a qemu_irq has a device on the other (receiving) end of it,
+ * return true; otherwise return false.
+ *
+ * Usually device models don't need to care whether the machine model
+ * has wired up their outbound qemu_irq lines, because functions like
+ * qemu_set_irq() silently do nothing if there is nothing on the other
+ * end of the line. However occasionally a device model will want to
+ * provide default behaviour if its output is left floating, and
+ * it can use this function to identify when that is the case.
+ */
+static inline bool qemu_irq_is_connected(qemu_irq irq)
+{
+ return irq != NULL;
+}
+
#endif