qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC v0 3/4] intc: arm_gic: Implement Linux boot


From: Peter Crosthwaite
Subject: [Qemu-devel] [RFC v0 3/4] intc: arm_gic: Implement Linux boot
Date: Tue, 30 Jun 2015 12:21:35 -0700

Change all the interrupt groups to 1 to enable interrupts from the NS
world. This gives a Linux guest full control of the interrupts when
booting directly with -kernel.

Signed-off-by: Peter Crosthwaite <address@hidden>
---
Needs to be rebased on Peter's work
---
---
 hw/intc/arm_gic.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index 454bfd7..9374145 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -22,6 +22,8 @@
 #include "gic_internal.h"
 #include "qom/cpu.h"
 
+#include "hw/guest/linux.h"
+
 //#define DEBUG_GIC
 
 #ifdef DEBUG_GIC
@@ -1135,13 +1137,28 @@ static void arm_gic_realize(DeviceState *dev, Error 
**errp)
     }
 }
 
+static void arm_gic_linux_init(LinuxDevice *obj)
+{
+    /* FIXME: rebase - this is based on Xilinx tree code */
+#if 0
+    GICState *s = ARM_GIC(obj);
+    int i;
+
+    for (i = 0 ; i < s->num_irq; ++i) {
+        s->irq_state[i].group = 1;
+    }
+#endif
+}
+
 static void arm_gic_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
     ARMGICClass *agc = ARM_GIC_CLASS(klass);
+    LinuxDeviceClass *ldc = LINUX_DEVICE_CLASS(klass);
 
     agc->parent_realize = dc->realize;
     dc->realize = arm_gic_realize;
+    ldc->linux_init = arm_gic_linux_init;
 }
 
 static const TypeInfo arm_gic_info = {
@@ -1150,6 +1167,10 @@ static const TypeInfo arm_gic_info = {
     .instance_size = sizeof(GICState),
     .class_init = arm_gic_class_init,
     .class_size = sizeof(ARMGICClass),
+    .interfaces = (InterfaceInfo []) {
+        { TYPE_LINUX_DEVICE },
+        { },
+    }
 };
 
 static void arm_gic_register_types(void)
-- 
2.4.5.3.g6a5966f




reply via email to

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