[PATCH 04/13] bsps: Add gicv3_ppi_set_pending()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Mar 18 07:19:06 UTC 2022


---
 bsps/include/dev/irq/arm-gicv3.h | 10 ++++++++++
 bsps/shared/dev/irq/arm-gicv3.c  |  5 +----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/bsps/include/dev/irq/arm-gicv3.h b/bsps/include/dev/irq/arm-gicv3.h
index cfc8cd3499..59052bebd2 100644
--- a/bsps/include/dev/irq/arm-gicv3.h
+++ b/bsps/include/dev/irq/arm-gicv3.h
@@ -166,6 +166,16 @@ static inline bool gicv3_sgi_ppi_is_pending(
   return (sgi_ppi->icspispendr[0] & (1U << vector)) != 0;
 }
 
+static inline void gicv3_ppi_set_pending(
+  rtems_vector_number vector,
+  uint32_t            cpu_index
+)
+{
+  volatile gic_sgi_ppi *sgi_ppi = gicv3_get_sgi_ppi(cpu_index);
+
+  sgi_ppi->icspispendr[0] = 1U << vector;
+}
+
 static inline void gicv3_trigger_sgi(
   rtems_vector_number vector,
   uint32_t            targets
diff --git a/bsps/shared/dev/irq/arm-gicv3.c b/bsps/shared/dev/irq/arm-gicv3.c
index 2f08d9bcb7..54e0c2af68 100644
--- a/bsps/shared/dev/irq/arm-gicv3.c
+++ b/bsps/shared/dev/irq/arm-gicv3.c
@@ -104,10 +104,7 @@ rtems_status_code bsp_interrupt_raise(rtems_vector_number vector)
   if (vector <= ARM_GIC_IRQ_SGI_LAST) {
     arm_gic_trigger_sgi(vector, 1U << _SMP_Get_current_processor());
   } else if (vector <= ARM_GIC_IRQ_PPI_LAST) {
-    volatile gic_sgi_ppi *sgi_ppi =
-      gicv3_get_sgi_ppi(_SMP_Get_current_processor());
-
-    sgi_ppi->icspispendr[0] = 1U << vector;
+    gicv3_ppi_set_pending(vector, _SMP_Get_current_processor());
   } else {
     volatile gic_dist *dist = ARM_GIC_DIST;
 
-- 
2.34.1



More information about the devel mailing list