[rtems commit] bsps/irq: Use rtems_malloc()

Sebastian Huber sebh at rtems.org
Mon Nov 12 14:43:58 UTC 2018


Module:    rtems
Branch:    master
Commit:    9a029cec02ab113bebd6fad6192917124421f04b
Changeset: http://git.rtems.org/rtems/commit/?id=9a029cec02ab113bebd6fad6192917124421f04b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov  9 13:06:52 2018 +0100

bsps/irq: Use rtems_malloc()

---

 bsps/shared/irq/irq-generic.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bsps/shared/irq/irq-generic.c b/bsps/shared/irq/irq-generic.c
index 10a9d18..fd12933 100644
--- a/bsps/shared/irq/irq-generic.c
+++ b/bsps/shared/irq/irq-generic.c
@@ -132,16 +132,21 @@ static inline bool bsp_interrupt_allocate_handler_index(
 
 static bsp_interrupt_handler_entry *bsp_interrupt_allocate_handler_entry(void)
 {
+  bsp_interrupt_handler_entry *e;
+
   #ifdef BSP_INTERRUPT_NO_HEAP_USAGE
     rtems_vector_number index = 0;
+
     if (bsp_interrupt_allocate_handler_index(0, &index)) {
-      return &bsp_interrupt_handler_table [index];
+      e = &bsp_interrupt_handler_table [index];
     } else {
-      return NULL;
+      e = NULL;
     }
   #else
-    return rtems_heap_allocate_aligned_with_boundary(sizeof(bsp_interrupt_handler_entry), 0, 0);
+    e = rtems_malloc(sizeof(*e));
   #endif
+
+  return e;
 }
 
 static void bsp_interrupt_free_handler_entry(bsp_interrupt_handler_entry *e)



More information about the vc mailing list