aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2018-12-06 00:22:16 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-12-21 09:24:23 +1100
commit5fd9ef18a9707c17d0f1d4262a76fa878edb65c3 (patch)
tree7466c5ad3106df0ef33f16453e15324901a5b812 /include
parent02e3ff548d2379c16990bac9cb84833231e0d20f (diff)
downloadqemu-5fd9ef18a9707c17d0f1d4262a76fa878edb65c3.zip
qemu-5fd9ef18a9707c17d0f1d4262a76fa878edb65c3.tar.gz
qemu-5fd9ef18a9707c17d0f1d4262a76fa878edb65c3.tar.bz2
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>
Diffstat (limited to 'include')
-rw-r--r--include/hw/ppc/xive.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 7aa2e38..7cebc32 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -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 */