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>
This commit is contained in:
Cédric Le Goater 2021-09-01 11:41:51 +02:00 committed by David Gibson
parent 0e5e9ff455
commit 89d2468d96
2 changed files with 17 additions and 15 deletions

View file

@ -458,6 +458,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)
*