[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v3 28/35] intc: introduce a CPUIntc interface
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v3 28/35] intc: introduce a CPUIntc interface |
Date: |
Thu, 19 Apr 2018 14:43:24 +0200 |
which we will use in the sPAPR machine to reset the interrupt
controller of each CPU at the KVM level.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/intc.c | 26 ++++++++++++++++++++++++++
include/hw/intc/intc.h | 21 +++++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/hw/intc/intc.c b/hw/intc/intc.c
index 2e1e29e753a1..bb08ff51596a 100644
--- a/hw/intc/intc.c
+++ b/hw/intc/intc.c
@@ -32,10 +32,36 @@ static const TypeInfo intctrl_info = {
.class_size = sizeof(InterruptStatsProviderClass),
};
+static const TypeInfo cpu_intc_info = {
+ .name = TYPE_CPU_INTC,
+ .parent = TYPE_INTERFACE,
+ .class_size = sizeof(CPUIntcClass),
+};
+
static void intc_register_types(void)
{
+ type_register_static(&cpu_intc_info);
type_register_static(&intctrl_info);
}
type_init(intc_register_types)
+void cpu_intc_disconnect(CPUIntc *intc, Error **errp)
+{
+ CPUIntcClass *cic;
+
+ cic = CPU_INTC_GET_CLASS(intc);
+ if (cic->disconnect) {
+ cic->disconnect(intc, errp);
+ }
+}
+
+void cpu_intc_connect(CPUIntc *intc, Error **errp)
+{
+ CPUIntcClass *cic;
+
+ cic = CPU_INTC_GET_CLASS(intc);
+ if (cic->connect) {
+ cic->connect(intc, errp);
+ }
+}
diff --git a/include/hw/intc/intc.h b/include/hw/intc/intc.h
index 27d9828943ae..3536e7d57ffd 100644
--- a/include/hw/intc/intc.h
+++ b/include/hw/intc/intc.h
@@ -30,4 +30,25 @@ typedef struct InterruptStatsProviderClass {
void (*print_info)(InterruptStatsProvider *obj, Monitor *mon);
} InterruptStatsProviderClass;
+#define TYPE_CPU_INTC "cpu-intc"
+#define CPU_INTC(obj) \
+ OBJECT_CHECK(CPUIntc, (obj), TYPE_CPU_INTC)
+#define CPU_INTC_CLASS(klass) \
+ OBJECT_CLASS_CHECK(CPUIntcClass, (klass), TYPE_CPU_INTC)
+#define CPU_INTC_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(CPUIntcClass, (obj), TYPE_CPU_INTC)
+
+typedef struct CPUIntc {
+ Object parent;
+} CPUIntc;
+
+typedef struct CPUIntcClass {
+ InterfaceClass parent;
+ void (*connect)(CPUIntc *icp, Error **errp);
+ void (*disconnect)(CPUIntc *icp, Error **errp);
+} CPUIntcClass;
+
+void cpu_intc_disconnect(CPUIntc *intc, Error **errp);
+void cpu_intc_connect(CPUIntc *intc, Error **errp);
+
#endif
--
2.13.6
- [Qemu-ppc] [PATCH v3 18/35] spapr: introduce a spapr_icp_create() helper, (continued)
- [Qemu-ppc] [PATCH v3 18/35] spapr: introduce a spapr_icp_create() helper, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 19/35] spapr: toggle the ICP depending on the selected interrupt mode, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 20/35] spapr: add support to dump XIVE information, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 21/35] spapr: advertise XIVE exploitation mode in CAS, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 22/35] spapr: add classes for the XIVE models, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 23/35] target/ppc/kvm: add Linux KVM definitions for XIVE, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 24/35] spapr/xive: add common realize routine for KVM, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 25/35] spapr/xive: add KVM support, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 26/35] spapr/xive: add a XIVE KVM device to the machine, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 27/35] migration: discard non-migratable RAMBlocks, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 28/35] intc: introduce a CPUIntc interface,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH v3 29/35] spapr/xive, xics: use the CPU_INTC handlers to reset KVM, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 30/35] spapr/xive, xics: reset KVM at machine reset, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 31/35] spapr/xive: raise migration priority of the machine, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 32/35] ppc/pnv: introduce a pnv_icp_create() helper, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 33/35] ppc: externalize ppc_get_vcpu_by_pir(), Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 34/35] ppc/pnv: add XIVE support, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 35/35] ppc/pnv: add a PSI bridge model for POWER9 processor, Cédric Le Goater, 2018/04/19
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v3 00/35] ppc: support for the XIVE interrupt controller (POWER9), no-reply, 2018/04/21