aboutsummaryrefslogtreecommitdiff
path: root/include/hw/intc
diff options
context:
space:
mode:
authorHervé Poussineau <hpoussin@reactos.org>2016-09-26 22:23:23 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-04 10:00:25 +0200
commit120e512b7f753f2e2978b47344f329c2595284de (patch)
tree32fa67d22d213184a36628985f1e3f728ed8daa0 /include/hw/intc
parenteabb5782f70b4a10975b24ccd7129929a05ac932 (diff)
intc: add an interface to gather statistics/informations on interrupt controllers
This interface will be used by HMP commands 'info irq' and 'info pic'. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-Id: <1474921408-24710-2-git-send-email-hpoussin@reactos.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/intc')
-rw-r--r--include/hw/intc/intc.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/hw/intc/intc.h b/include/hw/intc/intc.h
new file mode 100644
index 0000000000..27d9828943
--- /dev/null
+++ b/include/hw/intc/intc.h
@@ -0,0 +1,33 @@
+#ifndef INTC_H
+#define INTC_H
+
+#include "qom/object.h"
+
+#define TYPE_INTERRUPT_STATS_PROVIDER "intctrl"
+
+#define INTERRUPT_STATS_PROVIDER_CLASS(klass) \
+ OBJECT_CLASS_CHECK(InterruptStatsProviderClass, (klass), \
+ TYPE_INTERRUPT_STATS_PROVIDER)
+#define INTERRUPT_STATS_PROVIDER_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(InterruptStatsProviderClass, (obj), \
+ TYPE_INTERRUPT_STATS_PROVIDER)
+#define INTERRUPT_STATS_PROVIDER(obj) \
+ INTERFACE_CHECK(InterruptStatsProvider, (obj), \
+ TYPE_INTERRUPT_STATS_PROVIDER)
+
+typedef struct InterruptStatsProvider {
+ Object parent;
+} InterruptStatsProvider;
+
+typedef struct InterruptStatsProviderClass {
+ InterfaceClass parent;
+
+ /* The returned pointer and statistics must remain valid until
+ * the BQL is next dropped.
+ */
+ bool (*get_statistics)(InterruptStatsProvider *obj, uint64_t **irq_counts,
+ unsigned int *nb_irqs);
+ void (*print_info)(InterruptStatsProvider *obj, Monitor *mon);
+} InterruptStatsProviderClass;
+
+#endif