qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [RFC PATCH 12/26] ppc/xive: add a print_info() handler for th


From: Cédric Le Goater
Subject: [Qemu-ppc] [RFC PATCH 12/26] ppc/xive: add a print_info() handler for the interrupt source
Date: Wed, 5 Jul 2017 19:13:25 +0200

This is much like the default one but we expose the PQ bits also.

Signed-off-by: Cédric Le Goater <address@hidden>
---
 hw/intc/xive.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 0db97fd33981..db808e0cbe3d 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -290,6 +290,25 @@ static void xive_ics_set_irq(void *opaque, int srcno, int 
val)
     }
 }
 
+static void xive_ics_print_info(ICSState *ics, Monitor *mon)
+{
+    XiveICSState *xs = ICS_XIVE(ics);
+    int i;
+
+    for (i = 0; i < ics->nr_irqs; i++) {
+        ICSIRQState *irq = ics->irqs + i;
+
+        if (!(irq->flags & XICS_FLAGS_IRQ_MASK)) {
+            continue;
+        }
+        monitor_printf(mon, "  %4x %s pq=%02x status=%02x\n",
+                       ics->offset + i,
+                       (irq->flags & XICS_FLAGS_IRQ_LSI) ? "LSI" : "MSI",
+                       xive_pq_get(xs->xive, ics->offset + i),
+                       irq->status);
+    }
+}
+
 static void xive_ics_reset(void *dev)
 {
     ICSState *ics = ICS_BASE(dev);
@@ -364,6 +383,7 @@ static void xive_ics_class_init(ObjectClass *klass, void 
*data)
     ICSStateClass *isc = ICS_BASE_CLASS(klass);
 
     isc->realize = xive_ics_realize;
+    isc->print_info = xive_ics_print_info;
 
     dc->props = xive_ics_properties;
 }
-- 
2.7.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]