diff options
author | Cédric Le Goater <clg@kaod.org> | 2021-09-01 11:41:51 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-09-29 19:37:38 +1000 |
commit | 89d2468d964e635eb80d4d00c29074a28d0e6d19 (patch) | |
tree | 9e4b26f2616b40a673bbc9c75c55e353c00d6189 /include | |
parent | 0e5e9ff455dc529ee9e3c485d4543cdcaa04ab8b (diff) | |
download | qemu-89d2468d964e635eb80d4d00c29074a28d0e6d19.zip qemu-89d2468d964e635eb80d4d00c29074a28d0e6d19.tar.gz qemu-89d2468d964e635eb80d4d00c29074a28d0e6d19.tar.bz2 |
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')
-rw-r--r-- | include/hw/ppc/xive.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index db76411..29b130e 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 |