aboutsummaryrefslogtreecommitdiff
path: root/include/hw/ppc/xive.h
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2021-09-01 11:41:51 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2021-09-29 19:37:38 +1000
commit89d2468d964e635eb80d4d00c29074a28d0e6d19 (patch)
tree9e4b26f2616b40a673bbc9c75c55e353c00d6189 /include/hw/ppc/xive.h
parent0e5e9ff455dc529ee9e3c485d4543cdcaa04ab8b (diff)
ppc/xive: Export priority_to_ipb() helper
Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20210901094153.227671-7-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw/ppc/xive.h')
-rw-r--r--include/hw/ppc/xive.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index db76411654..29b130eaea 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -459,6 +459,17 @@ struct XiveENDSource {
#define XIVE_PRIORITY_MAX 7
/*
+ * Convert a priority number to an Interrupt Pending Buffer (IPB)
+ * register, which indicates a pending interrupt at the priority
+ * corresponding to the bit number
+ */
+static inline uint8_t xive_priority_to_ipb(uint8_t priority)
+{
+ return priority > XIVE_PRIORITY_MAX ?
+ 0 : 1 << (XIVE_PRIORITY_MAX - priority);
+}
+
+/*
* XIVE Thread Interrupt Management Aera (TIMA)
*
* This region gives access to the registers of the thread interrupt