[PATCH 12/13] bsps: Add gicv3_sgi_ppi_get_priority()

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


---
 bsps/include/dev/irq/arm-gicv3.h | 10 ++++++++++
 bsps/shared/dev/irq/arm-gicv3.c  |  7 ++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/bsps/include/dev/irq/arm-gicv3.h b/bsps/include/dev/irq/arm-gicv3.h
index 6f1d5254cc..6a716894b4 100644
--- a/bsps/include/dev/irq/arm-gicv3.h
+++ b/bsps/include/dev/irq/arm-gicv3.h
@@ -202,6 +202,16 @@ static inline void gicv3_sgi_ppi_set_priority(
   sgi_ppi->icspiprior[vector] = priority;
 }
 
+static inline uint8_t gicv3_sgi_ppi_get_priority(
+  rtems_vector_number vector,
+  uint32_t            cpu_index
+)
+{
+  volatile gic_sgi_ppi *sgi_ppi = gicv3_get_sgi_ppi(cpu_index);
+
+  return sgi_ppi->icspiprior[vector];
+}
+
 static inline bool gicv3_sgi_ppi_is_pending(
   rtems_vector_number vector,
   uint32_t            cpu_index
diff --git a/bsps/shared/dev/irq/arm-gicv3.c b/bsps/shared/dev/irq/arm-gicv3.c
index 096864a35e..d81f3b50c1 100644
--- a/bsps/shared/dev/irq/arm-gicv3.c
+++ b/bsps/shared/dev/irq/arm-gicv3.c
@@ -255,9 +255,10 @@ rtems_status_code arm_gic_irq_get_priority(
       volatile gic_dist *dist = ARM_GIC_DIST;
       *priority = gic_id_get_priority(dist, vector);
     } else {
-      volatile gic_sgi_ppi *sgi_ppi =
-        gicv3_get_sgi_ppi(_SMP_Get_current_processor());
-      *priority = sgi_ppi->icspiprior[vector];
+      *priority = gicv3_sgi_ppi_get_priority(
+        vector,
+        _SMP_Get_current_processor()
+      );
     }
   } else {
     sc = RTEMS_INVALID_ID;
-- 
2.34.1



More information about the devel mailing list