[PATCH 22/41] bsps/irq: Use rtems_interrupt_entry

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 12 12:49:44 UTC 2021


Update #3269.
---
 bsps/include/bsp/irq-generic.h        | 15 +++------------
 bsps/shared/irq/irq-generic.c         | 24 ++++++++++++------------
 bsps/shared/irq/irq-handler-iterate.c |  2 +-
 3 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/bsps/include/bsp/irq-generic.h b/bsps/include/bsp/irq-generic.h
index 68332d20b9..b553ac30bf 100644
--- a/bsps/include/bsp/irq-generic.h
+++ b/bsps/include/bsp/irq-generic.h
@@ -83,16 +83,7 @@ extern "C" {
 
 #define bsp_interrupt_assert(e) _Assert(e)
 
-struct bsp_interrupt_handler_entry {
-  rtems_interrupt_handler handler;
-  void *arg;
-  const char *info;
-  struct bsp_interrupt_handler_entry *next;
-};
-
-typedef struct bsp_interrupt_handler_entry bsp_interrupt_handler_entry;
-
-extern bsp_interrupt_handler_entry bsp_interrupt_handler_table [];
+extern rtems_interrupt_entry bsp_interrupt_handler_table [];
 
 #ifdef BSP_INTERRUPT_USE_INDEX_TABLE
   #if BSP_INTERRUPT_HANDLER_TABLE_SIZE < 0x100
@@ -386,7 +377,7 @@ static inline void bsp_interrupt_handler_dispatch_unchecked(
   rtems_vector_number vector
 )
 {
-  const bsp_interrupt_handler_entry *e;
+  const rtems_interrupt_entry *e;
 
   e = &bsp_interrupt_handler_table[ bsp_interrupt_handler_index( vector ) ];
 
@@ -494,7 +485,7 @@ void bsp_interrupt_handler_empty( void *arg );
  * @brief Checks if a handler entry is empty.
  */
 static inline bool bsp_interrupt_is_empty_handler_entry(
-  const bsp_interrupt_handler_entry *entry
+  const rtems_interrupt_entry *entry
 )
 {
   return entry->handler == bsp_interrupt_handler_empty;
diff --git a/bsps/shared/irq/irq-generic.c b/bsps/shared/irq/irq-generic.c
index 81da647228..a7e8c1163f 100644
--- a/bsps/shared/irq/irq-generic.c
+++ b/bsps/shared/irq/irq-generic.c
@@ -46,7 +46,7 @@
     [BSP_INTERRUPT_VECTOR_COUNT];
 #endif
 
-bsp_interrupt_handler_entry bsp_interrupt_handler_table
+rtems_interrupt_entry bsp_interrupt_handler_table
   [BSP_INTERRUPT_HANDLER_TABLE_SIZE];
 
 /* The last entry indicates if everything is initialized */
@@ -87,7 +87,7 @@ static inline void bsp_interrupt_set_initialized(void)
 }
 
 static inline void bsp_interrupt_clear_handler_entry(
-  bsp_interrupt_handler_entry *e,
+  rtems_interrupt_entry *e,
   rtems_vector_number vector
 )
 {
@@ -108,7 +108,7 @@ static inline bool bsp_interrupt_allocate_handler_index(
 
     /* The first entry will remain empty */
     for (i = 1; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) {
-      const bsp_interrupt_handler_entry *e = &bsp_interrupt_handler_table [i];
+      const rtems_interrupt_entry *e = &bsp_interrupt_handler_table [i];
       if (bsp_interrupt_is_empty_handler_entry(e)) {
         *index = i;
         return true;
@@ -164,7 +164,7 @@ static rtems_status_code bsp_interrupt_handler_install(
 {
   rtems_interrupt_level level;
   rtems_vector_number index = 0;
-  bsp_interrupt_handler_entry *head = NULL;
+  rtems_interrupt_entry *head = NULL;
   bool enable_vector = false;
   bool replace = RTEMS_INTERRUPT_IS_REPLACE(options);
 
@@ -218,9 +218,9 @@ static rtems_status_code bsp_interrupt_handler_install(
     /* This is the first handler so enable the vector later */
     enable_vector = true;
   } else {
-    bsp_interrupt_handler_entry *current = head;
-    bsp_interrupt_handler_entry *tail = NULL;
-    bsp_interrupt_handler_entry *match = NULL;
+    rtems_interrupt_entry *current = head;
+    rtems_interrupt_entry *tail = NULL;
+    rtems_interrupt_entry *match = NULL;
 
     /* Ensure that a unique handler remains unique */
     if (
@@ -327,10 +327,10 @@ static rtems_status_code bsp_interrupt_handler_remove(
 {
   rtems_interrupt_level level;
   rtems_vector_number index = 0;
-  bsp_interrupt_handler_entry *head = NULL;
-  bsp_interrupt_handler_entry *current = NULL;
-  bsp_interrupt_handler_entry *previous = NULL;
-  bsp_interrupt_handler_entry *match = NULL;
+  rtems_interrupt_entry *head = NULL;
+  rtems_interrupt_entry *current = NULL;
+  rtems_interrupt_entry *previous = NULL;
+  rtems_interrupt_entry *match = NULL;
 
   /* Check parameters and system state */
   if (!bsp_interrupt_is_initialized()) {
@@ -454,7 +454,7 @@ rtems_status_code rtems_interrupt_handler_remove(
 bool bsp_interrupt_handler_is_empty(rtems_vector_number vector)
 {
   rtems_vector_number index = 0;
-  bsp_interrupt_handler_entry *head = NULL;
+  rtems_interrupt_entry *head = NULL;
   bool empty;
 
   /* For use in interrupts so no lock. */
diff --git a/bsps/shared/irq/irq-handler-iterate.c b/bsps/shared/irq/irq-handler-iterate.c
index 8adbdb4679..3c642b075e 100644
--- a/bsps/shared/irq/irq-handler-iterate.c
+++ b/bsps/shared/irq/irq-handler-iterate.c
@@ -52,7 +52,7 @@ static rtems_status_code bsp_interrupt_handler_iterate(
   void *arg
 )
 {
-  bsp_interrupt_handler_entry *current = NULL;
+  rtems_interrupt_entry *current = NULL;
   rtems_option options = 0;
   rtems_vector_number index = 0;
 
-- 
2.26.2



More information about the devel mailing list