[Skiboot] [RFC PATCH 1/7] xive: Add helper to retrieve an IPI trigger port
Sukadev Bhattiprolu
sukadev at linux.vnet.ibm.com
Sat Nov 12 03:56:49 AEDT 2016
From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
To be used by such things as VAS
Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
hw/xive.c | 19 +++++++++++++++++++
include/xive.h | 5 +++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/hw/xive.c b/hw/xive.c
index dcd8d5b..84bb47f 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -1260,6 +1260,25 @@ uint32_t xive_alloc_ipi_irqs(uint32_t chip_id, uint32_t count, uint32_t align)
return base;
}
+void *xive_get_trigger_port(uint32_t girq)
+{
+ struct xive *x;
+ uint32_t idx;
+
+ /* Find XIVE on which the IVE resides */
+ x = xive_from_isn(girq);
+ if (!x)
+ return NULL;
+
+ /* Make sure it's an IPI on that chip */
+ if (girq < x->int_base ||
+ girq >= x->int_ipi_top)
+ return NULL;
+
+ idx = girq - x->int_base;
+ return x->esb_mmio + idx * 0x20000;
+}
+
uint64_t xive_get_notify_port(uint32_t chip_id, uint32_t ent)
{
struct proc_chip *chip = get_chip(chip_id);
diff --git a/include/xive.h b/include/xive.h
index 775ddd7..367daec 100644
--- a/include/xive.h
+++ b/include/xive.h
@@ -382,4 +382,9 @@ void xive_register_source(uint32_t base, uint32_t count, uint32_t shift,
void xive_cpu_callin(struct cpu_thread *cpu);
+/* Get the trigger page address for an interrupt allocated with
+ * xive_alloc_ipi_irqs()
+ */
+void *xive_get_trigger_port(uint32_t girq);
+
#endif /* __XIVE_H__ */
--
1.7.1
More information about the Skiboot
mailing list