GICv3: add raise softirq
authorLukas Humbel <lukas.humbel@inf.ethz.ch>
Wed, 15 Mar 2017 12:38:36 +0000 (13:38 +0100)
committerLukas Humbel <lukas.humbel@inf.ethz.ch>
Wed, 15 Mar 2017 14:54:18 +0000 (15:54 +0100)
Signed-off-by: Lukas Humbel <lukas.humbel@inf.ethz.ch>

kernel/arch/armv8/gic_v3.c
kernel/include/arch/armv8/gic_v3.h

index 2c49cbb..e6c3161 100644 (file)
@@ -54,7 +54,21 @@ void gicv3_ack_irq(uint32_t irq)
     armv8_ICC_EOIR1_EL1_rawwr(NULL, irq);
 }
 
+/*
+ * Raise an SGI on a core
+ */
+void gicv3_raise_softirq(uint8_t cpumask, uint8_t irq)
+{
+    assert(irq <= 15);
+    gic_v3_GICD_SGIR_t reg = 0;
+    reg = gic_v3_GICD_SGIR_INTID_insert(reg, irq);
+    reg = gic_v3_GICD_SGIR_CPUTargetList_insert(reg, cpumask);
+    gic_v3_GICD_SGIR_wr(&gic_v3_dev, reg);
+}
 
+/*
+ * Enable GIC CPU-IF and local distributor
+ */
 errval_t gicv3_cpu_interface_enable(void)
 {
     printk(LOG_NOTE, "gicv3_cpu_interface_enable: enabling group 1 int\n");
index 700a627..ae4afee 100644 (file)
@@ -25,4 +25,6 @@ uint32_t gicv3_get_active_irq(void);
 
 void gicv3_ack_irq(uint32_t irq);
 
+void gicv3_raise_softirq(uint8_t cpumask, uint8_t irq);
+
 #endif // __GIC_V3_H__