forked from Imagelibrary/rtems
@@ -83,16 +83,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define bsp_interrupt_assert(e) _Assert(e)
|
#define bsp_interrupt_assert(e) _Assert(e)
|
||||||
|
|
||||||
struct bsp_interrupt_handler_entry {
|
extern rtems_interrupt_entry bsp_interrupt_handler_table [];
|
||||||
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 [];
|
|
||||||
|
|
||||||
#ifdef BSP_INTERRUPT_USE_INDEX_TABLE
|
#ifdef BSP_INTERRUPT_USE_INDEX_TABLE
|
||||||
#if BSP_INTERRUPT_HANDLER_TABLE_SIZE < 0x100
|
#if BSP_INTERRUPT_HANDLER_TABLE_SIZE < 0x100
|
||||||
@@ -386,7 +377,7 @@ static inline void bsp_interrupt_handler_dispatch_unchecked(
|
|||||||
rtems_vector_number vector
|
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 ) ];
|
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.
|
* @brief Checks if a handler entry is empty.
|
||||||
*/
|
*/
|
||||||
static inline bool bsp_interrupt_is_empty_handler_entry(
|
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;
|
return entry->handler == bsp_interrupt_handler_empty;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
[BSP_INTERRUPT_VECTOR_COUNT];
|
[BSP_INTERRUPT_VECTOR_COUNT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bsp_interrupt_handler_entry bsp_interrupt_handler_table
|
rtems_interrupt_entry bsp_interrupt_handler_table
|
||||||
[BSP_INTERRUPT_HANDLER_TABLE_SIZE];
|
[BSP_INTERRUPT_HANDLER_TABLE_SIZE];
|
||||||
|
|
||||||
/* The last entry indicates if everything is initialized */
|
/* 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(
|
static inline void bsp_interrupt_clear_handler_entry(
|
||||||
bsp_interrupt_handler_entry *e,
|
rtems_interrupt_entry *e,
|
||||||
rtems_vector_number vector
|
rtems_vector_number vector
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -108,7 +108,7 @@ static inline bool bsp_interrupt_allocate_handler_index(
|
|||||||
|
|
||||||
/* The first entry will remain empty */
|
/* The first entry will remain empty */
|
||||||
for (i = 1; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) {
|
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)) {
|
if (bsp_interrupt_is_empty_handler_entry(e)) {
|
||||||
*index = i;
|
*index = i;
|
||||||
return true;
|
return true;
|
||||||
@@ -164,7 +164,7 @@ static rtems_status_code bsp_interrupt_handler_install(
|
|||||||
{
|
{
|
||||||
rtems_interrupt_level level;
|
rtems_interrupt_level level;
|
||||||
rtems_vector_number index = 0;
|
rtems_vector_number index = 0;
|
||||||
bsp_interrupt_handler_entry *head = NULL;
|
rtems_interrupt_entry *head = NULL;
|
||||||
bool enable_vector = false;
|
bool enable_vector = false;
|
||||||
bool replace = RTEMS_INTERRUPT_IS_REPLACE(options);
|
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 */
|
/* This is the first handler so enable the vector later */
|
||||||
enable_vector = true;
|
enable_vector = true;
|
||||||
} else {
|
} else {
|
||||||
bsp_interrupt_handler_entry *current = head;
|
rtems_interrupt_entry *current = head;
|
||||||
bsp_interrupt_handler_entry *tail = NULL;
|
rtems_interrupt_entry *tail = NULL;
|
||||||
bsp_interrupt_handler_entry *match = NULL;
|
rtems_interrupt_entry *match = NULL;
|
||||||
|
|
||||||
/* Ensure that a unique handler remains unique */
|
/* Ensure that a unique handler remains unique */
|
||||||
if (
|
if (
|
||||||
@@ -327,10 +327,10 @@ static rtems_status_code bsp_interrupt_handler_remove(
|
|||||||
{
|
{
|
||||||
rtems_interrupt_level level;
|
rtems_interrupt_level level;
|
||||||
rtems_vector_number index = 0;
|
rtems_vector_number index = 0;
|
||||||
bsp_interrupt_handler_entry *head = NULL;
|
rtems_interrupt_entry *head = NULL;
|
||||||
bsp_interrupt_handler_entry *current = NULL;
|
rtems_interrupt_entry *current = NULL;
|
||||||
bsp_interrupt_handler_entry *previous = NULL;
|
rtems_interrupt_entry *previous = NULL;
|
||||||
bsp_interrupt_handler_entry *match = NULL;
|
rtems_interrupt_entry *match = NULL;
|
||||||
|
|
||||||
/* Check parameters and system state */
|
/* Check parameters and system state */
|
||||||
if (!bsp_interrupt_is_initialized()) {
|
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)
|
bool bsp_interrupt_handler_is_empty(rtems_vector_number vector)
|
||||||
{
|
{
|
||||||
rtems_vector_number index = 0;
|
rtems_vector_number index = 0;
|
||||||
bsp_interrupt_handler_entry *head = NULL;
|
rtems_interrupt_entry *head = NULL;
|
||||||
bool empty;
|
bool empty;
|
||||||
|
|
||||||
/* For use in interrupts so no lock. */
|
/* For use in interrupts so no lock. */
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ static rtems_status_code bsp_interrupt_handler_iterate(
|
|||||||
void *arg
|
void *arg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
bsp_interrupt_handler_entry *current = NULL;
|
rtems_interrupt_entry *current = NULL;
|
||||||
rtems_option options = 0;
|
rtems_option options = 0;
|
||||||
rtems_vector_number index = 0;
|
rtems_vector_number index = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user