43#ifndef LIBBSP_SHARED_IRQ_GENERIC_H
44#define LIBBSP_SHARED_IRQ_GENERIC_H
62#if !defined(BSP_INTERRUPT_VECTOR_COUNT)
63 #error "BSP_INTERRUPT_VECTOR_COUNT shall be defined"
66#if defined(BSP_INTERRUPT_USE_INDEX_TABLE) && !defined(BSP_INTERRUPT_DISPATCH_TABLE_SIZE)
67 #error "if you define BSP_INTERRUPT_USE_INDEX_TABLE, you have to define BSP_INTERRUPT_DISPATCH_TABLE_SIZE etc. as well"
70#ifndef BSP_INTERRUPT_DISPATCH_TABLE_SIZE
71 #define BSP_INTERRUPT_DISPATCH_TABLE_SIZE BSP_INTERRUPT_VECTOR_COUNT
74#if !defined(BSP_IRQ_HAVE_GET_SET_AFFINITY) && defined(RTEMS_SMP)
75 #define BSP_IRQ_HAVE_GET_SET_AFFINITY
78#define bsp_interrupt_assert(e) _Assert(e)
86#ifdef BSP_INTERRUPT_USE_INDEX_TABLE
87 #if BSP_INTERRUPT_DISPATCH_TABLE_SIZE < 0x100
88 typedef uint8_t bsp_interrupt_dispatch_index_type;
89 #elif BSP_INTERRUPT_DISPATCH_TABLE_SIZE < 0x10000
90 typedef uint16_t bsp_interrupt_dispatch_index_type;
92 typedef uint32_t bsp_interrupt_dispatch_index_type;
94 extern bsp_interrupt_dispatch_index_type bsp_interrupt_dispatch_index_table [];
101 #ifdef BSP_INTERRUPT_USE_INDEX_TABLE
102 return bsp_interrupt_dispatch_index_table [vector];
158#ifdef BSP_INTERRUPT_CUSTOM_VALID_VECTOR
340#if defined(RTEMS_SMP)
449 Processor_mask *affinity
475 const Processor_mask *affinity
478#if defined(RTEMS_SMP)
498#if defined(RTEMS_SMP)
500 (
const Atomic_Uintptr *) ptr,
515static inline void bsp_interrupt_entry_store_release(
520#if defined(RTEMS_SMP)
521 _Atomic_Store_uintptr(
522 (Atomic_Uintptr *) ptr,
548 index = bsp_interrupt_dispatch_index( vector );
550 return bsp_interrupt_entry_load_acquire(
566static inline void bsp_interrupt_dispatch_entries(
572 entry = bsp_interrupt_entry_load_acquire( &
entry->next );
592static inline void bsp_interrupt_handler_dispatch_unlikely(
598 entry = bsp_interrupt_entry_load_first( vector );
601 bsp_interrupt_dispatch_entries(
entry );
618static inline void bsp_interrupt_handler_dispatch_unchecked(
624 entry = bsp_interrupt_entry_load_first( vector );
627 bsp_interrupt_dispatch_entries(
entry );
629#if defined(RTEMS_SMP)
630 bsp_interrupt_spurious( vector );
653 if ( bsp_interrupt_is_valid_vector( vector ) ) {
654 bsp_interrupt_handler_dispatch_unchecked( vector );
711void bsp_interrupt_entry_remove(
742 table_index = index / 8;
743 bit = (uint8_t) ( 1U << ( index % 8 ) );
755static inline void bsp_interrupt_set_handler_unique(
763 table_index = index / 8;
764 bit = (uint8_t) ( 1U << ( index % 8 ) );
779static inline bool bsp_interrupt_is_initialized(
void )
781 return bsp_interrupt_is_handler_unique( BSP_INTERRUPT_DISPATCH_TABLE_SIZE );
This header file provides the interfaces of the Assert Handler.
#define RTEMS_PREDICT_FALSE(_exp)
Evaluates the integral expression and tells the compiler that the predicted value is false (0).
Definition: basedefs.h:732
#define RTEMS_PREDICT_TRUE(_exp)
Evaluates the integral expression and tells the compiler that the predicted value is true (1).
Definition: basedefs.h:751
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
#define rtems_interrupt_local_disable(_isr_cookie)
Disables the maskable interrupts on the current processor.
Definition: intr.h:427
ISR_Level rtems_interrupt_level
This integer type represents interrupt levels.
Definition: intr.h:111
void(* rtems_interrupt_handler)(void *)
Interrupt handler routines shall have this type.
Definition: intr.h:1030
#define rtems_interrupt_local_enable(_isr_cookie)
Restores the previous interrupt level on the current processor.
Definition: intr.h:468
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
Disables the interrupt vector.
Definition: irq.c:153
rtems_status_code bsp_interrupt_set_priority(rtems_vector_number vector, uint32_t priority)
Sets the priority of the interrupt vector.
Definition: irq.c:166
rtems_status_code bsp_interrupt_vector_is_enabled(rtems_vector_number vector, bool *enabled)
Checks if the interrupt is enabled.
Definition: irq.c:129
void bsp_interrupt_handler_default(rtems_vector_number vector)
Default interrupt handler.
Definition: irq.c:250
rtems_status_code bsp_interrupt_get_affinity(rtems_vector_number vector, Processor_mask *affinity)
Gets the processor affinity set of the interrupt vector.
Definition: irq.c:426
rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
Enables the interrupt vector.
Definition: irq.c:140
void bsp_interrupt_facility_initialize(void)
BSP specific initialization.
Definition: irq.c:185
rtems_status_code bsp_interrupt_get_priority(rtems_vector_number vector, uint32_t *priority)
Gets the priority of the interrupt vector.
Definition: irq.c:175
rtems_status_code bsp_interrupt_raise(rtems_vector_number vector)
Causes the interrupt vector.
Definition: irq.c:117
rtems_status_code bsp_interrupt_is_pending(rtems_vector_number vector, bool *pending)
Checks if the interrupt is pending.
Definition: irq.c:106
rtems_status_code bsp_interrupt_clear(rtems_vector_number vector)
Clears the interrupt vector.
Definition: irq.c:123
rtems_status_code bsp_interrupt_get_attributes(rtems_vector_number vector, rtems_interrupt_attributes *attributes)
Gets the attributes of the interrupt vector.
Definition: irq.c:98
void bsp_interrupt_initialize(void)
Initialize Interrupt Manager implementation.
Definition: irq-generic.c:163
rtems_status_code bsp_interrupt_set_affinity(rtems_vector_number vector, const Processor_mask *affinity)
Sets the processor affinity set of the interrupt vector.
Definition: irq.c:406
This header file provides the interfaces of the Atomic Operations.
This header file is provided for backward compatiblility.
uint8_t bsp_interrupt_handler_unique_table[]
This table contains a bit map which indicates if an entry is unique or shared.
Definition: irq-generic.c:58
rtems_interrupt_entry ** bsp_interrupt_get_dispatch_table_slot(rtems_vector_number index)
Gets a reference to the interrupt handler table slot associated with the index.
Definition: irq-generic.c:49
rtems_interrupt_entry * bsp_interrupt_dispatch_table[]
Each member of this table references the first installed entry at the corresponding interrupt vector ...
Definition: irq-generic.c:47
void bsp_interrupt_lock(void)
Acquires the interrupt support lock.
Definition: irq-lock.c:42
void bsp_interrupt_unlock(void)
Releases the interrupt support lock.
Definition: irq-lock.c:49
rtems_status_code bsp_interrupt_check_and_lock(rtems_vector_number vector, rtems_interrupt_handler handler)
Checks the vector and routine. When the checks were successful, the interrupt support lock will be ob...
Definition: irq-generic.c:110
This header file provides the interfaces of the Processor Mask.
Definition: mmu-config.c:53
This structure provides the attributes of an interrupt vector.
Definition: intr.h:2076
This structure represents an interrupt entry.
Definition: intr.h:1070