mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-10 17:43:21 +00:00
bsps/irq: Remove BSP_INTERRUPT_NO_HEAP_USAGE
Remove the support for BSP_INTERRUPT_NO_HEAP_USAGE. This was only used by one BSP and provides no real benefit. Update #3269.
This commit is contained in:
@@ -66,10 +66,6 @@ extern "C" {
|
|||||||
#error "if you define BSP_INTERRUPT_USE_INDEX_TABLE, you have to define BSP_INTERRUPT_HANDLER_TABLE_SIZE etc. as well"
|
#error "if you define BSP_INTERRUPT_USE_INDEX_TABLE, you have to define BSP_INTERRUPT_HANDLER_TABLE_SIZE etc. as well"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BSP_INTERRUPT_NO_HEAP_USAGE) && !defined(BSP_INTERRUPT_USE_INDEX_TABLE)
|
|
||||||
#error "if you define BSP_INTERRUPT_NO_HEAP_USAGE, you have to define BSP_INTERRUPT_USE_INDEX_TABLE etc. as well"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BSP_INTERRUPT_VECTOR_NUMBER \
|
#define BSP_INTERRUPT_VECTOR_NUMBER \
|
||||||
(BSP_INTERRUPT_VECTOR_MAX - BSP_INTERRUPT_VECTOR_MIN + 1)
|
(BSP_INTERRUPT_VECTOR_MAX - BSP_INTERRUPT_VECTOR_MIN + 1)
|
||||||
|
|
||||||
@@ -150,10 +146,6 @@ static inline rtems_vector_number bsp_interrupt_handler_index(
|
|||||||
* table will be accessed via a small index table. You can define the size of
|
* table will be accessed via a small index table. You can define the size of
|
||||||
* the handler table with @ref BSP_INTERRUPT_HANDLER_TABLE_SIZE.
|
* the handler table with @ref BSP_INTERRUPT_HANDLER_TABLE_SIZE.
|
||||||
*
|
*
|
||||||
* Normally new list entries are allocated from the heap. You may define
|
|
||||||
* @ref BSP_INTERRUPT_NO_HEAP_USAGE, if you do not want to use the heap. For
|
|
||||||
* this option you have to define @ref BSP_INTERRUPT_USE_INDEX_TABLE as well.
|
|
||||||
*
|
|
||||||
* You have to provide some special routines in your BSP (follow the links for
|
* You have to provide some special routines in your BSP (follow the links for
|
||||||
* the details):
|
* the details):
|
||||||
* - bsp_interrupt_facility_initialize()
|
* - bsp_interrupt_facility_initialize()
|
||||||
|
|||||||
@@ -483,7 +483,6 @@ rtems_status_code mpc55xx_intc_clear_software_irq(rtems_vector_number vector);
|
|||||||
|
|
||||||
#ifdef BSP_INTERRUPT_HANDLER_TABLE_SIZE
|
#ifdef BSP_INTERRUPT_HANDLER_TABLE_SIZE
|
||||||
#define BSP_INTERRUPT_USE_INDEX_TABLE
|
#define BSP_INTERRUPT_USE_INDEX_TABLE
|
||||||
#define BSP_INTERRUPT_NO_HEAP_USAGE
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@@ -142,34 +142,6 @@ static inline bool bsp_interrupt_allocate_handler_index(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
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)) {
|
|
||||||
e = &bsp_interrupt_handler_table [index];
|
|
||||||
} else {
|
|
||||||
e = NULL;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
e = rtems_malloc(sizeof(*e));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bsp_interrupt_free_handler_entry(bsp_interrupt_handler_entry *e)
|
|
||||||
{
|
|
||||||
#ifdef BSP_INTERRUPT_NO_HEAP_USAGE
|
|
||||||
bsp_interrupt_clear_handler_entry(e, 0);
|
|
||||||
#else
|
|
||||||
free(e);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void bsp_interrupt_initialize(void)
|
void bsp_interrupt_initialize(void)
|
||||||
{
|
{
|
||||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||||
@@ -318,7 +290,7 @@ static rtems_status_code bsp_interrupt_handler_install(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate a new entry */
|
/* Allocate a new entry */
|
||||||
current = bsp_interrupt_allocate_handler_entry();
|
current = rtems_malloc(sizeof(*current));
|
||||||
if (current == NULL) {
|
if (current == NULL) {
|
||||||
/* Not enough memory */
|
/* Not enough memory */
|
||||||
bsp_interrupt_unlock();
|
bsp_interrupt_unlock();
|
||||||
@@ -433,7 +405,7 @@ static rtems_status_code bsp_interrupt_handler_remove(
|
|||||||
match->next = current->next;
|
match->next = current->next;
|
||||||
bsp_interrupt_enable(level);
|
bsp_interrupt_enable(level);
|
||||||
|
|
||||||
bsp_interrupt_free_handler_entry(current);
|
free(current);
|
||||||
} else if (match == head) {
|
} else if (match == head) {
|
||||||
/*
|
/*
|
||||||
* The match is the list head and has no successor.
|
* The match is the list head and has no successor.
|
||||||
@@ -465,7 +437,7 @@ static rtems_status_code bsp_interrupt_handler_remove(
|
|||||||
bsp_interrupt_fence(ATOMIC_ORDER_RELEASE);
|
bsp_interrupt_fence(ATOMIC_ORDER_RELEASE);
|
||||||
bsp_interrupt_enable(level);
|
bsp_interrupt_enable(level);
|
||||||
|
|
||||||
bsp_interrupt_free_handler_entry(match);
|
free(match);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* No matching entry found */
|
/* No matching entry found */
|
||||||
|
|||||||
Reference in New Issue
Block a user