mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
ppc/xive: add support for the LSI interrupt sources
The 'sent' status of the LSI interrupt source is modeled with the 'P' bit of the ESB and the assertion status of the source is maintained with an extra bit under the main XiveSource object. The type of the source is stored in the same array for practical reasons. Signed-off-by: Cédric Le Goater <clg@kaod.org> [dwg: Fix style nit] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
02e3ff548d
commit
5fd9ef18a9
2 changed files with 79 additions and 7 deletions
|
@ -162,8 +162,9 @@ typedef struct XiveSource {
|
|||
/* IRQs */
|
||||
uint32_t nr_irqs;
|
||||
qemu_irq *qirqs;
|
||||
unsigned long *lsi_map;
|
||||
|
||||
/* PQ bits */
|
||||
/* PQ bits and LSI assertion bit */
|
||||
uint8_t *status;
|
||||
|
||||
/* ESB memory region */
|
||||
|
@ -219,6 +220,7 @@ static inline hwaddr xive_source_esb_mgmt(XiveSource *xsrc, int srcno)
|
|||
* When doing an EOI, the Q bit will indicate if the interrupt
|
||||
* needs to be re-triggered.
|
||||
*/
|
||||
#define XIVE_STATUS_ASSERTED 0x4 /* Extra bit for LSI */
|
||||
#define XIVE_ESB_VAL_P 0x2
|
||||
#define XIVE_ESB_VAL_Q 0x1
|
||||
|
||||
|
@ -257,4 +259,19 @@ static inline qemu_irq xive_source_qirq(XiveSource *xsrc, uint32_t srcno)
|
|||
return xsrc->qirqs[srcno];
|
||||
}
|
||||
|
||||
static inline bool xive_source_irq_is_lsi(XiveSource *xsrc, uint32_t srcno)
|
||||
{
|
||||
assert(srcno < xsrc->nr_irqs);
|
||||
return test_bit(srcno, xsrc->lsi_map);
|
||||
}
|
||||
|
||||
static inline void xive_source_irq_set(XiveSource *xsrc, uint32_t srcno,
|
||||
bool lsi)
|
||||
{
|
||||
assert(srcno < xsrc->nr_irqs);
|
||||
if (lsi) {
|
||||
bitmap_set(xsrc->lsi_map, srcno, 1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PPC_XIVE_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue