RTEMS 6.3
Loading...
Searching...
No Matches
intr.h File Reference

This header file defines the Interrupt Manager API. More...

#include <stddef.h>
#include <stdint.h>
#include <sys/cpuset.h>
#include <rtems/rtems/attr.h>
#include <rtems/rtems/modes.h>
#include <rtems/rtems/options.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/types.h>
#include <rtems/score/basedefs.h>
#include <rtems/score/chain.h>
#include <rtems/score/cpu.h>
#include <rtems/score/cpuopts.h>
#include <rtems/score/isr.h>
#include <rtems/score/isrlevel.h>
#include <rtems/score/isrlock.h>
#include <rtems/score/smplock.h>

Go to the source code of this file.

Data Structures

struct  rtems_interrupt_entry
 This structure represents an interrupt entry. More...
struct  rtems_interrupt_attributes
 This structure provides the attributes of an interrupt vector. More...
struct  rtems_interrupt_server_control
 This structure represents an interrupt server. More...
struct  rtems_interrupt_server_config
 This structure defines an interrupt server configuration. More...
struct  rtems_interrupt_server_action
 This structure represents an interrupt server action. More...
struct  rtems_interrupt_server_entry
 This structure represents an interrupt server entry. More...
struct  rtems_interrupt_server_request
 This structure represents an interrupt server request. More...

Macros

#define rtems_interrupt_disable(_isr_cookie)
 Disables the maskable interrupts on the current processor.
#define rtems_interrupt_enable(_isr_cookie)
 Restores the previous interrupt level on the current processor.
#define rtems_interrupt_flash(_isr_cookie)
 Flashes interrupts on the current processor.
#define rtems_interrupt_local_disable(_isr_cookie)
 Disables the maskable interrupts on the current processor.
#define rtems_interrupt_local_enable(_isr_cookie)
 Restores the previous interrupt level on the current processor.
#define rtems_interrupt_is_in_progress()
 Checks if an ISR is in progress on the current processor.
#define RTEMS_INTERRUPT_LOCK_NEEDS_OBJECT   ISR_LOCK_NEEDS_OBJECT
 If this define has a non-zero value, then the interrupt lock operations require an object of type rtems_interrupt_lock, otherwise no lock object is required.
#define rtems_interrupt_lock_initialize(_lock, _name)
 Initializes the ISR lock.
#define rtems_interrupt_lock_destroy(_lock)
 Destroys the ISR lock.
#define rtems_interrupt_lock_acquire(_lock, _lock_context)
 Acquires the ISR lock.
#define rtems_interrupt_lock_release(_lock, _lock_context)
 Releases the ISR lock.
#define rtems_interrupt_lock_acquire_isr(_lock, _lock_context)
 Acquires the ISR lock from within an ISR.
#define rtems_interrupt_lock_release_isr(_lock, _lock_context)
 Releases the ISR lock from within an ISR.
#define rtems_interrupt_lock_interrupt_disable(_lock_context)
 Disables maskable interrupts on the current processor.
#define RTEMS_INTERRUPT_LOCK_DECLARE(_specifier, _designator)
 Declares an ISR lock object.
#define RTEMS_INTERRUPT_LOCK_DEFINE(_specifier, _designator, _name)
 Defines an ISR lock object.
#define RTEMS_INTERRUPT_LOCK_INITIALIZER(_name)
 Statically initializes an ISR lock object.
#define RTEMS_INTERRUPT_LOCK_MEMBER(_designator)
 Defines an ISR lock member.
#define RTEMS_INTERRUPT_LOCK_REFERENCE(_designator, _target)
 Defines an ISR lock object reference.
#define RTEMS_INTERRUPT_SHARED   ( (rtems_option) 0x00000000 )
 This interrupt handler install option allows that the interrupt handler may share the interrupt vector with other handler.
#define RTEMS_INTERRUPT_UNIQUE   ( (rtems_option) 0x00000001 )
 This interrupt handler install option ensures that the interrupt handler is unique.
#define RTEMS_INTERRUPT_REPLACE   ( (rtems_option) 0x00000002 )
 This interrupt handler install option requests that the interrupt handler replaces the first handler with the same argument.
#define RTEMS_INTERRUPT_IS_SHARED(_options)
 Checks if the interrupt handler shared option is set.
#define RTEMS_INTERRUPT_IS_UNIQUE(_options)
 Checks if the interrupt handler unique option is set.
#define RTEMS_INTERRUPT_IS_REPLACE(_options)
 Checks if the interrupt handler replace option is set.
#define RTEMS_INTERRUPT_ENTRY_INITIALIZER(_routine, _arg, _info)
 Statically initializes an interrupt entry object.
#define RTEMS_INTERRUPT_SERVER_DEFAULT   0
 The constant represents the index of the default interrupt server.

Typedefs

typedef ISR_Vector_number rtems_vector_number
 This integer type represents interrupt vector numbers.
typedef ISR_Level rtems_interrupt_level
 This integer type represents interrupt levels.
typedef ISR_Handler rtems_isr
 This type defines the return type of interrupt service routines.
typedef ISR_Handler_entry rtems_isr_entry
 Interrupt service routines installed by rtems_interrupt_catch() shall have this type.
typedef char rtems_interrupt_lock
 This structure represents an ISR lock.
typedef ISR_lock_Context rtems_interrupt_lock_context
 This structure provides an ISR lock context for acquire and release pairs.
typedef void(*) rtems_interrupt_handler(void *)
 Interrupt handler routines shall have this type.
typedef 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.
typedef struct rtems_interrupt_entry rtems_interrupt_entry
 This structure represents an interrupt entry.
typedef struct rtems_interrupt_server_control rtems_interrupt_server_control
 This structure represents an interrupt server.
typedef struct rtems_interrupt_server_action rtems_interrupt_server_action
 This structure represents an interrupt server action.

Enumerations

enum  rtems_interrupt_signal_variant {
  RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL , RTEMS_INTERRUPT_NO_SIGNAL , RTEMS_INTERRUPT_SIGNAL_LEVEL_LOW , RTEMS_INTERRUPT_SIGNAL_LEVEL_HIGH ,
  RTEMS_INTERRUPT_SIGNAL_EDGE_FALLING , RTEMS_INTERRUPT_SIGNAL_EDGE_RAISING
}
 This enumeration provides interrupt trigger signal variants. More...

Functions

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.
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.
rtems_status_code rtems_interrupt_entry_remove (rtems_vector_number vector, rtems_interrupt_entry *entry)
 Removes the interrupt entry from the interrupt vector.
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.
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.
rtems_status_code rtems_interrupt_vector_is_enabled (rtems_vector_number vector, bool *enabled)
 Checks if the interrupt vector is enabled.
rtems_status_code rtems_interrupt_vector_enable (rtems_vector_number vector)
 Enables the interrupt vector.
rtems_status_code rtems_interrupt_vector_disable (rtems_vector_number vector)
 Disables the interrupt vector.
rtems_status_code rtems_interrupt_is_pending (rtems_vector_number vector, bool *pending)
 Checks if the interrupt is pending.
rtems_status_code rtems_interrupt_raise (rtems_vector_number vector)
 Raises the interrupt vector.
rtems_status_code rtems_interrupt_raise_on (rtems_vector_number vector, uint32_t cpu_index)
 Raises the interrupt vector on the processor.
rtems_status_code rtems_interrupt_clear (rtems_vector_number vector)
 Clears the interrupt vector.
rtems_status_code rtems_interrupt_get_priority (rtems_vector_number vector, uint32_t *priority)
 Gets the priority of the interrupt vector.
rtems_status_code rtems_interrupt_set_priority (rtems_vector_number vector, uint32_t priority)
 Sets the priority of the interrupt vector.
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.
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.
rtems_status_code rtems_interrupt_get_attributes (rtems_vector_number vector, rtems_interrupt_attributes *attributes)
 Gets the attributes of the interrupt vector.
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.
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.
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.
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.
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.
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.
rtems_status_code rtems_interrupt_server_delete (uint32_t server_index)
 Deletes the interrupt server.
rtems_status_code rtems_interrupt_server_suspend (uint32_t server_index)
 Suspends the interrupt server.
rtems_status_code rtems_interrupt_server_resume (uint32_t server_index)
 Resumes the interrupt server.
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 destination interrupt server.
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.
rtems_status_code rtems_interrupt_server_entry_initialize (uint32_t server_index, rtems_interrupt_server_entry *entry)
 Initializes the interrupt server entry.
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.
void rtems_interrupt_server_entry_destroy (rtems_interrupt_server_entry *entry)
 Destroys the interrupt server entry.
void rtems_interrupt_server_entry_submit (rtems_interrupt_server_entry *entry)
 Submits the interrupt server entry to be serviced by the interrupt server.
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.
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.

Detailed Description

This header file defines the Interrupt Manager API.

Macro Definition Documentation

◆ RTEMS_INTERRUPT_IS_REPLACE

#define RTEMS_INTERRUPT_IS_REPLACE ( _options)
Value:
( ( _options ) & RTEMS_INTERRUPT_REPLACE )
#define RTEMS_INTERRUPT_REPLACE
This interrupt handler install option requests that the interrupt handler replaces the first handler ...
Definition intr.h:982

Checks if the interrupt handler replace option is set.

Parameters
_optionsis the interrupt handler option set to check.
Returns
Returns true, if the interrupt handler replace option RTEMS_INTERRUPT_REPLACE is set, otherwise false.

◆ RTEMS_INTERRUPT_IS_SHARED

#define RTEMS_INTERRUPT_IS_SHARED ( _options)
Value:
( ( _options ) & RTEMS_INTERRUPT_SHARED )
#define RTEMS_INTERRUPT_SHARED
This interrupt handler install option allows that the interrupt handler may share the interrupt vecto...
Definition intr.h:960

Checks if the interrupt handler shared option is set.

Parameters
_optionsis the interrupt handler option set to check.
Returns
Returns true, if the interrupt handler shared option RTEMS_INTERRUPT_SHARED is set, otherwise false.

◆ RTEMS_INTERRUPT_IS_UNIQUE

#define RTEMS_INTERRUPT_IS_UNIQUE ( _options)
Value:
( ( _options ) & RTEMS_INTERRUPT_UNIQUE )
#define RTEMS_INTERRUPT_UNIQUE
This interrupt handler install option ensures that the interrupt handler is unique.
Definition intr.h:972

Checks if the interrupt handler unique option is set.

Parameters
_optionsis the interrupt handler option set to check.
Returns
Returns true, if the interrupt handler unique option RTEMS_INTERRUPT_UNIQUE is set, otherwise false.