]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/irqchip/irq-gic.c
ARM: GIC: interface to send a SGI directly
[karo-tx-linux.git] / drivers / irqchip / irq-gic.c
index 09fdf3d574cd9953db08a06865c165ed1883c969..9031171c141b52c5e9175fdbf6eec9bd0c4224b3 100644 (file)
@@ -673,6 +673,20 @@ void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
 #endif
 
 #ifdef CONFIG_BL_SWITCHER
+/*
+ * gic_send_sgi - send a SGI directly to given CPU interface number
+ *
+ * cpu_id: the ID for the destination CPU interface
+ * irq: the IPI number to send a SGI for
+ */
+void gic_send_sgi(unsigned int cpu_id, unsigned int irq)
+{
+       BUG_ON(cpu_id >= NR_GIC_CPU_IF);
+       cpu_id = 1 << cpu_id;
+       /* this always happens on GIC0 */
+       writel_relaxed((cpu_id << 16) | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
+}
+
 /*
  * gic_get_cpu_id - get the CPU interface ID for the specified CPU
  *