summary refs log tree commit diff stats
path: root/hw/intc/gicv3_internal.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-11-26 16:39:14 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-11-26 16:58:57 +0000
commitb74d7c0e50ac4bde85c0ff629bfc23cdf378e62c (patch)
treea837cfb71e905d1b06678e19d0b7287b8ba5b60a /hw/intc/gicv3_internal.h
parent101f27f3c834842238624b6c0205be3281883878 (diff)
downloadfocaccia-qemu-b74d7c0e50ac4bde85c0ff629bfc23cdf378e62c.tar.gz
focaccia-qemu-b74d7c0e50ac4bde85c0ff629bfc23cdf378e62c.zip
hw/intc/arm_gicv3: Add new gicv3_intid_is_special() function
The GICv3/v4 pseudocode has a function IsSpecial() which returns true
if passed a "special" interrupt ID number (anything between 1020 and
1023 inclusive).  We open-code this condition in a couple of places,
so abstract it out into a new function gicv3_intid_is_special().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'hw/intc/gicv3_internal.h')
-rw-r--r--hw/intc/gicv3_internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/intc/gicv3_internal.h b/hw/intc/gicv3_internal.h
index 70f34ee495..b9c37453b0 100644
--- a/hw/intc/gicv3_internal.h
+++ b/hw/intc/gicv3_internal.h
@@ -412,6 +412,19 @@ FIELD(MAPC, RDBASE, 16, 32)
 /* Functions internal to the emulated GICv3 */
 
 /**
+ * gicv3_intid_is_special:
+ * @intid: interrupt ID
+ *
+ * Return true if @intid is a special interrupt ID (1020 to
+ * 1023 inclusive). This corresponds to the GIC spec pseudocode
+ * IsSpecial() function.
+ */
+static inline bool gicv3_intid_is_special(int intid)
+{
+    return intid >= INTID_SECURE && intid <= INTID_SPURIOUS;
+}
+
+/**
  * gicv3_redist_update:
  * @cs: GICv3CPUState for this redistributor
  *