56#ifndef _RTEMS_RTEMS_INTR_H
57#define _RTEMS_RTEMS_INTR_H
61#include <sys/cpuset.h>
69#include <rtems/score/cpu.h>
70#include <rtems/score/cpuopts.h>
133#if CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE
194#if !defined(RTEMS_SMP)
264 #define rtems_interrupt_disable( _isr_cookie ) _ISR_Local_disable( _isr_cookie )
267#if !defined(RTEMS_SMP)
311 #define rtems_interrupt_enable( _isr_cookie ) _ISR_Local_enable( _isr_cookie )
314#if !defined(RTEMS_SMP)
354 #define rtems_interrupt_flash( _isr_cookie ) _ISR_Local_flash( _isr_cookie )
427#define rtems_interrupt_local_disable( _isr_cookie ) \
428 _ISR_Local_disable( _isr_cookie )
468#define rtems_interrupt_local_enable( _isr_cookie ) \
469 _ISR_Local_enable( _isr_cookie )
495#define rtems_interrupt_is_in_progress() _ISR_Is_in_progress()
529#if ISR_LOCK_NEEDS_OBJECT
549#define RTEMS_INTERRUPT_LOCK_NEEDS_OBJECT ISR_LOCK_NEEDS_OBJECT
577#define rtems_interrupt_lock_initialize( _lock, _name ) \
578 _ISR_lock_Initialize( _lock, _name )
609#define rtems_interrupt_lock_destroy( _lock ) _ISR_lock_Destroy( _lock )
666#define rtems_interrupt_lock_acquire( _lock, _lock_context ) \
667 _ISR_lock_ISR_disable_and_acquire( _lock, _lock_context )
709#define rtems_interrupt_lock_release( _lock, _lock_context ) \
710 _ISR_lock_Release_and_ISR_enable( _lock, _lock_context )
756#if ISR_LOCK_NEEDS_OBJECT
757 #define rtems_interrupt_lock_acquire_isr( _lock, _lock_context ) \
760 &( _lock_context )->Lock_context \
763 #define rtems_interrupt_lock_acquire_isr( _lock, _lock_context ) \
764 do { (void) _lock_context; } while ( 0 )
802#if ISR_LOCK_NEEDS_OBJECT
803 #define rtems_interrupt_lock_release_isr( _lock, _lock_context ) \
806 &( _lock_context )->Lock_context \
809 #define rtems_interrupt_lock_release_isr( _lock, _lock_context ) \
810 do { (void) _lock_context; } while ( 0 )
835#define rtems_interrupt_lock_interrupt_disable( _lock_context ) \
836 _ISR_lock_ISR_disable( _lock_context )
853#if ISR_LOCK_NEEDS_OBJECT
854 #define RTEMS_INTERRUPT_LOCK_DECLARE( _specifier, _designator ) \
855 _specifier rtems_interrupt_lock _designator;
857 #define RTEMS_INTERRUPT_LOCK_DECLARE( _specifier, _designator )
884#if ISR_LOCK_NEEDS_OBJECT
885 #define RTEMS_INTERRUPT_LOCK_DEFINE( _specifier, _designator, _name ) \
886 _specifier rtems_interrupt_lock _designator = ISR_LOCK_INITIALIZER( _name );
888 #define RTEMS_INTERRUPT_LOCK_DEFINE( _specifier, _designator, _name )
906#if ISR_LOCK_NEEDS_OBJECT
907 #define RTEMS_INTERRUPT_LOCK_INITIALIZER( _name ) ISR_LOCK_INITIALIZER( _name )
909 #define RTEMS_INTERRUPT_LOCK_INITIALIZER( _name ) 0
924#if ISR_LOCK_NEEDS_OBJECT
925 #define RTEMS_INTERRUPT_LOCK_MEMBER( _designator ) \
926 rtems_interrupt_lock _designator;
928 #define RTEMS_INTERRUPT_LOCK_MEMBER( _designator )
945#if ISR_LOCK_NEEDS_OBJECT
946 #define RTEMS_INTERRUPT_LOCK_REFERENCE( _designator, _target ) \
947 rtems_interrupt_lock *_designator = _target;
949 #define RTEMS_INTERRUPT_LOCK_REFERENCE( _designator, _target )
960#define RTEMS_INTERRUPT_SHARED ( (rtems_option) 0x00000000 )
972#define RTEMS_INTERRUPT_UNIQUE ( (rtems_option) 0x00000001 )
982#define RTEMS_INTERRUPT_REPLACE ( (rtems_option) 0x00000002 )
994#define RTEMS_INTERRUPT_IS_SHARED( _options ) \
995 ( ( _options ) & RTEMS_INTERRUPT_SHARED )
1007#define RTEMS_INTERRUPT_IS_UNIQUE( _options ) \
1008 ( ( _options ) & RTEMS_INTERRUPT_UNIQUE )
1020#define RTEMS_INTERRUPT_IS_REPLACE( _options ) \
1021 ( ( _options ) & RTEMS_INTERRUPT_REPLACE )
1109#define RTEMS_INTERRUPT_ENTRY_INITIALIZER( _routine, _arg, _info ) \
1110 { _routine, _arg, NULL, _info }
1140static inline void rtems_interrupt_entry_initialize(
1147 entry->handler = routine;
1955 size_t affinity_size,
2017 size_t affinity_size,
2018 const cpu_set_t *affinity
2315#define RTEMS_INTERRUPT_SERVER_DEFAULT 0
2338 #if defined(RTEMS_SMP)
2508 uint32_t *server_count
2554 uint32_t *server_index
2630 uint32_t server_index,
2685 uint32_t server_index,
2750 uint32_t server_index,
2751 size_t affinity_size,
2752 const cpu_set_t *affinity,
2909 uint32_t source_server_index,
2911 uint32_t destination_server_index
2965 uint32_t server_index,
3091 uint32_t server_index,
3303 uint32_t server_index
3385 uint32_t server_index,
3444static inline void rtems_interrupt_server_request_set_vector(
3481static inline void rtems_interrupt_server_request_destroy(
3538static inline void rtems_interrupt_server_request_submit(
This header file provides Classic API directive attributes.
This header file provides basic definitions used by the API and the implementation.
This header file provides types used by the Classic API.
uint32_t rtems_attribute
This type represents Classic API attributes.
Definition: attr.h:96
ISR_Handler_entry rtems_isr_entry
Interrupt service routines installed by rtems_interrupt_catch() shall have this type.
Definition: intr.h:134
rtems_status_code rtems_interrupt_server_handler_install(uint32_t server_index, rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler routine, void *arg)
Installs the interrupt handler routine and argument at the interrupt vector on the interrupt server.
Definition: irq-server.c:373
rtems_status_code rtems_interrupt_server_handler_iterate(uint32_t server_index, rtems_vector_number vector, rtems_interrupt_per_handler_routine routine, void *arg)
Iterates over all interrupt handler installed at the interrupt vector and interrupt server.
Definition: irq-server.c:461
rtems_status_code rtems_interrupt_vector_disable(rtems_vector_number vector)
Disables the interrupt vector.
Definition: irq-enable-disable.c:94
ISR_Handler rtems_isr
This type defines the return type of interrupt service routines.
Definition: intr.h:123
rtems_status_code rtems_interrupt_server_handler_remove(uint32_t server_index, rtems_vector_number vector, rtems_interrupt_handler routine, void *arg)
Removes the interrupt handler routine and argument from the interrupt vector and the interrupt server...
Definition: irq-server.c:400
rtems_status_code rtems_interrupt_set_affinity(rtems_vector_number vector, size_t affinity_size, const cpu_set_t *affinity)
Sets the processor affinity set of the interrupt vector.
Definition: irq-affinity.c:41
rtems_status_code rtems_interrupt_entry_install(rtems_vector_number vector, rtems_option options, rtems_interrupt_entry *entry)
Installs the interrupt entry at the interrupt vector.
Definition: irq-generic.c:264
rtems_status_code rtems_interrupt_handler_iterate(rtems_vector_number vector, rtems_interrupt_per_handler_routine routine, void *arg)
Iterates over all interrupt handler installed at the interrupt vector.
Definition: irq-handler-iterate.c:39
rtems_status_code rtems_interrupt_is_pending(rtems_vector_number vector, bool *pending)
Checks if the interrupt is pending.
Definition: irq-raise-clear.c:43
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler routine, void *arg)
Installs the interrupt handler routine and argument at the interrupt vector.
Definition: irq-handler-install.c:85
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
rtems_status_code rtems_interrupt_vector_is_enabled(rtems_vector_number vector, bool *enabled)
Checks if the interrupt vector is enabled.
Definition: irq-enable-disable.c:69
rtems_status_code rtems_interrupt_server_resume(uint32_t server_index)
Resumes the interrupt server.
Definition: irq-server.c:989
rtems_status_code rtems_interrupt_server_entry_move(rtems_interrupt_server_entry *entry, uint32_t server_index)
Moves the interrupt server entry to the interrupt server.
Definition: irq-server.c:800
rtems_status_code rtems_interrupt_entry_remove(rtems_vector_number vector, rtems_interrupt_entry *entry)
Removes the interrupt entry from the interrupt vector.
Definition: irq-entry-remove.c:94
rtems_status_code rtems_interrupt_server_set_affinity(uint32_t server_index, size_t affinity_size, const cpu_set_t *affinity, rtems_task_priority priority)
Sets the processor affinity of the interrupt server.
Definition: irq-server.c:1011
rtems_status_code rtems_interrupt_get_attributes(rtems_vector_number vector, rtems_interrupt_attributes *attributes)
Gets the attributes of the interrupt vector.
Definition: irq-enable-disable.c:42
rtems_status_code rtems_interrupt_server_initialize(rtems_task_priority priority, size_t stack_size, rtems_mode modes, rtems_attribute attributes, uint32_t *server_count)
Initializes the interrupt server tasks.
Definition: irq-server.c:577
rtems_status_code rtems_interrupt_server_entry_initialize(uint32_t server_index, rtems_interrupt_server_entry *entry)
Initializes the interrupt server entry.
Definition: irq-server.c:766
rtems_status_code rtems_interrupt_raise_on(rtems_vector_number vector, uint32_t cpu_index)
Raises the interrupt vector on the processor.
Definition: irq-raise-clear.c:68
void rtems_interrupt_server_entry_destroy(rtems_interrupt_server_entry *entry)
Destroys the interrupt server entry.
Definition: irq-server.c:824
ISR_Level rtems_interrupt_level
This integer type represents interrupt levels.
Definition: intr.h:111
void rtems_interrupt_server_entry_submit(rtems_interrupt_server_entry *entry)
Submits the interrupt server entry to be serviced by the interrupt server.
Definition: irq-server.c:793
rtems_status_code rtems_interrupt_server_delete(uint32_t server_index)
Deletes the interrupt server.
Definition: irq-server.c:721
rtems_status_code rtems_interrupt_server_request_initialize(uint32_t server_index, rtems_interrupt_server_request *request, rtems_interrupt_handler routine, void *arg)
Initializes the interrupt server request.
Definition: irq-server.c:851
rtems_status_code rtems_interrupt_raise(rtems_vector_number vector)
Raises the interrupt vector.
Definition: irq-raise-clear.c:59
char rtems_interrupt_lock
This structure represents an ISR lock.
Definition: intr.h:532
rtems_status_code rtems_interrupt_handler_remove(rtems_vector_number vector, rtems_interrupt_handler routine, void *arg)
Removes the interrupt handler routine and argument from the interrupt vector.
Definition: irq-handler-remove.c:62
rtems_status_code rtems_interrupt_get_priority(rtems_vector_number vector, uint32_t *priority)
Gets the priority of the interrupt vector.
Definition: irq-priority.c:51
void rtems_interrupt_server_action_prepend(rtems_interrupt_server_entry *entry, rtems_interrupt_server_action *action, rtems_interrupt_handler routine, void *arg)
Prepends the interrupt server action to the list of actions of the interrupt server entry.
Definition: irq-server.c:783
rtems_status_code rtems_interrupt_catch(rtems_isr_entry new_isr_handler, rtems_vector_number vector, rtems_isr_entry *old_isr_handler)
Establishes an interrupt service routine.
Definition: intrcatch.c:46
rtems_status_code rtems_interrupt_server_suspend(uint32_t server_index)
Suspends the interrupt server.
Definition: irq-server.c:968
void(* rtems_interrupt_handler)(void *)
Interrupt handler routines shall have this type.
Definition: intr.h:1030
rtems_status_code rtems_interrupt_vector_enable(rtems_vector_number vector)
Enables the interrupt vector.
Definition: irq-enable-disable.c:85
ISR_lock_Context rtems_interrupt_lock_context
This structure provides an ISR lock context for acquire and release pairs.
Definition: intr.h:559
rtems_interrupt_signal_variant
This enumeration provides interrupt trigger signal variants.
Definition: intr.h:2028
void(* rtems_interrupt_per_handler_routine)(void *, const char *, rtems_option, rtems_interrupt_handler, void *)
Visitor routines invoked by rtems_interrupt_handler_iterate() shall have this type.
Definition: intr.h:1040
rtems_status_code rtems_interrupt_server_create(rtems_interrupt_server_control *control, const rtems_interrupt_server_config *config, uint32_t *server_index)
Creates an interrupt server.
Definition: irq-server.c:656
rtems_status_code rtems_interrupt_server_move(uint32_t source_server_index, rtems_vector_number vector, uint32_t destination_server_index)
Moves the interrupt handlers installed at the interrupt vector and the source interrupt server to the...
Definition: irq-server.c:917
rtems_status_code rtems_interrupt_clear(rtems_vector_number vector)
Clears the interrupt vector.
Definition: irq-raise-clear.c:92
rtems_status_code rtems_interrupt_get_affinity(rtems_vector_number vector, size_t affinity_size, cpu_set_t *affinity)
Gets the processor affinity set of the interrupt vector.
Definition: irq-affinity.c:75
rtems_status_code rtems_interrupt_set_priority(rtems_vector_number vector, uint32_t priority)
Sets the priority of the interrupt vector.
Definition: irq-priority.c:39
@ RTEMS_INTERRUPT_SIGNAL_LEVEL_LOW
This interrupt signal variant indicates that the interrupt is triggered by a low level signal.
Definition: intr.h:2045
@ RTEMS_INTERRUPT_SIGNAL_EDGE_FALLING
This interrupt signal variant indicates that the interrupt is triggered by a falling edge signal.
Definition: intr.h:2057
@ RTEMS_INTERRUPT_NO_SIGNAL
This interrupt signal variant indicates that the interrupt cannot be triggered by a signal.
Definition: intr.h:2039
@ RTEMS_INTERRUPT_SIGNAL_LEVEL_HIGH
This interrupt signal variant indicates that the interrupt is triggered by a high level signal.
Definition: intr.h:2051
@ RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL
This interrupt signal variant indicates that the interrupt trigger signal is unspecified.
Definition: intr.h:2033
@ RTEMS_INTERRUPT_SIGNAL_EDGE_RAISING
This interrupt signal variant indicates that the interrupt is triggered by a raising edge signal.
Definition: intr.h:2063
uint32_t rtems_mode
This type represents a Classic API task mode set.
Definition: modes.h:174
uint32_t rtems_option
This type represents a Classic API directive option set.
Definition: options.h:126
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
uint32_t rtems_name
This type represents Classic API object names.
Definition: types.h:226
uint32_t rtems_task_priority
This integer type represents task priorities of the Classic API.
Definition: types.h:257
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
void ISR_Handler
Definition: isr.h:72
uint32_t ISR_Level
Definition: isrlevel.h:60
uint32_t ISR_Vector_number
Definition: isr.h:67
This header file provides the main interfaces of the ISR Handler.
This header file provides the ISR_Level related interfaces of the ISR Handler.
This header file provides the interfaces of the ISR Locks.
This header file provides the task modes API of the Task Manager.
This header file provides the Classic API directive options.
This header file provides the status codes of Classic API directives and support functions.
This header file provides interfaces of the Chain Handler which are used by the implementation and th...
This header file provides the main interfaces of the SMP Locks.
This structure represents a chain node.
Definition: chain.h:78
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:94
Definition: deflate.c:114
Definition: intercom.c:87
Definition: mmu-config.c:53
This structure provides the attributes of an interrupt vector.
Definition: intr.h:2076
bool can_raise_on
This member is true, if the interrupt vector can be raised on a processor by rtems_interrupt_raise_on...
Definition: intr.h:2140
bool can_disable
This member is true, if the interrupt vector can be disabled by rtems_interrupt_vector_disable(),...
Definition: intr.h:2117
bool can_set_priority
This member is true, if the priority of the interrupt vector can be set by rtems_interrupt_set_priori...
Definition: intr.h:2198
bool maybe_enable
This member is true, if the interrupt vector may be enabled by rtems_interrupt_vector_enable(),...
Definition: intr.h:2107
rtems_interrupt_signal_variant trigger_signal
This member describes the trigger signal of the interrupt associated with the interrupt vector.
Definition: intr.h:2186
bool can_raise
This member is true, if the interrupt vector can be raised by rtems_interrupt_raise(),...
Definition: intr.h:2134
bool can_clear
This member is true, if the interrupt vector can be cleared by rtems_interrupt_clear(),...
Definition: intr.h:2146
bool can_set_affinity
This member is true, if the affinity set of the interrupt vector can be set by rtems_interrupt_set_af...
Definition: intr.h:2165
bool cleared_by_acknowledge
This member is true, if the pending status of the interrupt associated with the interrupt vector is c...
Definition: intr.h:2153
uint32_t maximum_priority
This member represents the maximum priority value of the interrupt vector. By convention,...
Definition: intr.h:2209
bool maybe_disable
This member is true, if the interrupt vector may be disabled by rtems_interrupt_vector_disable(),...
Definition: intr.h:2128
bool can_get_priority
This member is true, if the priority of the interrupt vector can be obtained by rtems_interrupt_get_p...
Definition: intr.h:2192
bool is_maskable
This member is true, if the interrupt vector is maskable by rtems_interrupt_local_disable(),...
Definition: intr.h:2085
bool can_enable
This member is true, if the interrupt vector can be enabled by rtems_interrupt_vector_enable(),...
Definition: intr.h:2095
bool can_get_affinity
This member is true, if the affinity set of the interrupt vector can be obtained by rtems_interrupt_g...
Definition: intr.h:2159
bool can_be_triggered_by_message
This member is true, if the interrupt associated with the interrupt vector can be triggered by a mess...
Definition: intr.h:2176
This structure represents an interrupt entry.
Definition: intr.h:1070
rtems_interrupt_handler handler
This member is the interrupt handler routine.
Definition: intr.h:1074
void * arg
This member is the interrupt handler argument.
Definition: intr.h:1079
struct rtems_interrupt_entry * next
This member is the reference to the next entry or NULL.
Definition: intr.h:1084
const char * info
This member is the descriptive information of the entry.
Definition: intr.h:1089
This structure represents an interrupt server action.
Definition: intr.h:2989
void * arg
This member is the interrupt handler argument.
Definition: intr.h:3003
struct rtems_interrupt_server_action * next
This member is the reference to the next action or NULL.
Definition: intr.h:2993
rtems_interrupt_handler handler
This member is the interrupt handler.
Definition: intr.h:2998
This structure defines an interrupt server configuration.
Definition: intr.h:2394
size_t storage_size
This member is the task storage size of the interrupt server.
Definition: intr.h:2419
rtems_mode modes
This member is the initial mode set of the interrupt server.
Definition: intr.h:2424
rtems_attribute attributes
This member is the attribute set of the interrupt server.
Definition: intr.h:2429
rtems_name name
This member is the task name of the interrupt server.
Definition: intr.h:2398
rtems_task_priority priority
This member is the initial task priority of the interrupt server.
Definition: intr.h:2403
void * storage_area
This member is the task storage area of the interrupt server.
Definition: intr.h:2411
This structure represents an interrupt server.
Definition: intr.h:2337
Chain_Node node
This member is the node for the interrupt server registry.
Definition: intr.h:2368
Chain_Control entries
This member is the chain of pending interrupt entries.
Definition: intr.h:2348
uint32_t index
This member is the server index.
Definition: intr.h:2363
void(* destroy)(struct rtems_interrupt_server_control *)
This member is the optional handler to destroy the interrupt server control.
Definition: intr.h:2374
rtems_id server
This member is the identifier of the server task.
Definition: intr.h:2353
unsigned long errors
This member is the error count.
Definition: intr.h:2358
This structure represents an interrupt server entry.
Definition: intr.h:3028
Chain_Node node
This member is the node for the interrupt entry processing.
Definition: intr.h:3032
rtems_interrupt_server_action * actions
This member is the interrupt server actions list head.
Definition: intr.h:3048
rtems_vector_number vector
This member is the interrupt vector number.
Definition: intr.h:3043
rtems_interrupt_server_control * server
This member references the interrupt server used to process the entry.
Definition: intr.h:3038
This structure represents an interrupt server request.
Definition: intr.h:3329
rtems_interrupt_server_action action
This member is the interrupt server action.
Definition: intr.h:3338
rtems_interrupt_server_entry entry
This member is the interrupt server entry.
Definition: intr.h:3333
This union represents a chain control block.
Definition: chain.h:96