[PATCH 2/5] bsps/arm: Use interrupt entry for clock driver

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 24 13:05:47 UTC 2023


Avoid a dynamic memory allocation for the clock driver interrupt.
---
 bsps/arm/shared/clock/clock-a9mpcore.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/bsps/arm/shared/clock/clock-a9mpcore.c b/bsps/arm/shared/clock/clock-a9mpcore.c
index 15c5d8b067..8d36d82afc 100644
--- a/bsps/arm/shared/clock/clock-a9mpcore.c
+++ b/bsps/arm/shared/clock/clock-a9mpcore.c
@@ -63,16 +63,21 @@ static void a9mpcore_clock_at_tick(void)
   gt->irqst = A9MPCORE_GT_IRQST_EFLG;
 }
 
+static rtems_interrupt_entry a9mpcore_clock_interrupt_entry =
+  RTEMS_INTERRUPT_ENTRY_INITIALIZER(
+    (rtems_interrupt_handler) Clock_isr,
+    NULL,
+    "Clock"
+  );
+
 static void a9mpcore_clock_handler_install(void)
 {
   rtems_status_code sc;
 
-  sc = rtems_interrupt_handler_install(
+  sc = rtems_interrupt_entry_install(
     A9MPCORE_IRQ_GT,
-    "Clock",
     RTEMS_INTERRUPT_UNIQUE,
-    (rtems_interrupt_handler) Clock_isr,
-    NULL
+    &a9mpcore_clock_interrupt_entry
   );
   if (sc != RTEMS_SUCCESSFUL) {
     bsp_fatal(BSP_ARM_A9MPCORE_FATAL_CLOCK_IRQ_INSTALL);
-- 
2.35.3



More information about the devel mailing list