RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
Signal Manager

The Signal Manager provides the capabilities required for asynchronous communication. More...

Macros

#define RTEMS_SIGNAL_0   0x00000001
 This signal set constant represents the bit in the signal set associated with signal 0.
 
#define RTEMS_SIGNAL_1   0x00000002
 This signal set constant represents the bit in the signal set associated with signal 1.
 
#define RTEMS_SIGNAL_2   0x00000004
 This signal set constant represents the bit in the signal set associated with signal 2.
 
#define RTEMS_SIGNAL_3   0x00000008
 This signal set constant represents the bit in the signal set associated with signal 3.
 
#define RTEMS_SIGNAL_4   0x00000010
 This signal set constant represents the bit in the signal set associated with signal 4.
 
#define RTEMS_SIGNAL_5   0x00000020
 This signal set constant represents the bit in the signal set associated with signal 5.
 
#define RTEMS_SIGNAL_6   0x00000040
 This signal set constant represents the bit in the signal set associated with signal 6.
 
#define RTEMS_SIGNAL_7   0x00000080
 This signal set constant represents the bit in the signal set associated with signal 7.
 
#define RTEMS_SIGNAL_8   0x00000100
 This signal set constant represents the bit in the signal set associated with signal 8.
 
#define RTEMS_SIGNAL_9   0x00000200
 This signal set constant represents the bit in the signal set associated with signal 9.
 
#define RTEMS_SIGNAL_10   0x00000400
 This signal set constant represents the bit in the signal set associated with signal 10.
 
#define RTEMS_SIGNAL_11   0x00000800
 This signal set constant represents the bit in the signal set associated with signal 11.
 
#define RTEMS_SIGNAL_12   0x00001000
 This signal set constant represents the bit in the signal set associated with signal 12.
 
#define RTEMS_SIGNAL_13   0x00002000
 This signal set constant represents the bit in the signal set associated with signal 13.
 
#define RTEMS_SIGNAL_14   0x00004000
 This signal set constant represents the bit in the signal set associated with signal 14.
 
#define RTEMS_SIGNAL_15   0x00008000
 This signal set constant represents the bit in the signal set associated with signal 15.
 
#define RTEMS_SIGNAL_16   0x00010000
 This signal set constant represents the bit in the signal set associated with signal 16.
 
#define RTEMS_SIGNAL_17   0x00020000
 This signal set constant represents the bit in the signal set associated with signal 17.
 
#define RTEMS_SIGNAL_18   0x00040000
 This signal set constant represents the bit in the signal set associated with signal 18.
 
#define RTEMS_SIGNAL_19   0x00080000
 This signal set constant represents the bit in the signal set associated with signal 19.
 
#define RTEMS_SIGNAL_20   0x00100000
 This signal set constant represents the bit in the signal set associated with signal 20.
 
#define RTEMS_SIGNAL_21   0x00200000
 This signal set constant represents the bit in the signal set associated with signal 21.
 
#define RTEMS_SIGNAL_22   0x00400000
 This signal set constant represents the bit in the signal set associated with signal 22.
 
#define RTEMS_SIGNAL_23   0x00800000
 This signal set constant represents the bit in the signal set associated with signal 23.
 
#define RTEMS_SIGNAL_24   0x01000000
 This signal set constant represents the bit in the signal set associated with signal 24.
 
#define RTEMS_SIGNAL_25   0x02000000
 This signal set constant represents the bit in the signal set associated with signal 25.
 
#define RTEMS_SIGNAL_26   0x04000000
 This signal set constant represents the bit in the signal set associated with signal 26.
 
#define RTEMS_SIGNAL_27   0x08000000
 This signal set constant represents the bit in the signal set associated with signal 27.
 
#define RTEMS_SIGNAL_28   0x10000000
 This signal set constant represents the bit in the signal set associated with signal 28.
 
#define RTEMS_SIGNAL_29   0x20000000
 This signal set constant represents the bit in the signal set associated with signal 29.
 
#define RTEMS_SIGNAL_30   0x40000000
 This signal set constant represents the bit in the signal set associated with signal 30.
 
#define RTEMS_SIGNAL_31   0x80000000
 This signal set constant represents the bit in the signal set associated with signal 31.
 

Typedefs

typedef void rtems_asr
 This type defines the return type of routines which are used to process asynchronous signals.
 
typedef uint32_t rtems_signal_set
 This integer type represents a bit field which can hold exactly 32 individual signals.
 
typedef rtems_asr(* rtems_asr_entry) (rtems_signal_set)
 This type defines the prototype of routines which are used to process asynchronous signals.
 

Functions

rtems_status_code rtems_signal_catch (rtems_asr_entry asr_handler, rtems_mode mode_set)
 Establishes an asynchronous signal routine (ASR) for the calling task.
 
rtems_status_code rtems_signal_send (rtems_id id, rtems_signal_set signal_set)
 Sends the signal set to the task.
 

Detailed Description

The Signal Manager provides the capabilities required for asynchronous communication.

Typedef Documentation

◆ rtems_asr

typedef void rtems_asr

This type defines the return type of routines which are used to process asynchronous signals.

Notes
This type can be used to document asynchronous signal routines in the source code.

Function Documentation

◆ rtems_signal_catch()

rtems_status_code rtems_signal_catch ( rtems_asr_entry  asr_handler,
rtems_mode  mode_set 
)

Establishes an asynchronous signal routine (ASR) for the calling task.

Parameters
asr_handleris the handler to process an asynchronous signal set.
mode_setis the task mode while an asynchronous signal set is processed by the handler. See rtems_task_mode().

This directive establishes an asynchronous signal routine (ASR) for the calling task. The asr_handler parameter specifies the entry point of the ASR. A task may have at most one handler installed at a time. The most recently installed handler is used. When asr_handler is NULL, the ASR for the calling task is invalidated and all pending signals are cleared. Any signals sent to a task with an invalid ASR are discarded. The mode_set parameter specifies the execution mode for the ASR. This execution mode supersedes the task's execution mode while the ASR is executing.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_NOT_IMPLEMENTEDThe RTEMS_NO_PREEMPT was set in mode_set and the system configuration had no implementation for this mode.
RTEMS_NOT_IMPLEMENTEDThe RTEMS_INTERRUPT_LEVEL() was set to a positive level in mode_set and the system configuration had no implementation for this mode.
Notes

It is strongly recommended to disable ASR processing during ASR processing by setting RTEMS_NO_ASR in mode_set, otherwise a recursion may happen during ASR processing. Uncontrolled recursion may lead to stack overflows.

Using the same mutex (in particular a recursive mutex) in normal task context and during ASR processing may result in undefined behaviour.

Asynchronous signal handlers can access thread-local storage (TLS). When thread-local storage is shared between normal task context and ASR processing, it may be protected by disabled interrupts.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within task context.
  • The directive will not cause the calling task to be preempted.

◆ rtems_signal_send()

rtems_status_code rtems_signal_send ( rtems_id  id,
rtems_signal_set  signal_set 
)

Sends the signal set to the task.

Parameters
idis the identifier of the target task to receive the signal set.
signal_setis the signal set to send.

This directive sends the signal set, signal_set, to the target task identified by id.

If a caller sends a signal set to a task with an invalid ASR, then an error code is returned to the caller. If a caller sends a signal set to a task whose ASR is valid but disabled, then the signal set will be caught and left pending for the ASR to process when it is enabled. If a caller sends a signal set to a task with an ASR that is both valid and enabled, then the signal set is caught and the ASR will execute the next time the task is dispatched to run.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_INVALID_NUMBERThe signal_set parameter was 0.
RTEMS_INVALID_IDThere was no task associated with the identifier specified by id.
RTEMS_NOT_DEFINEDThe target task had no valid ASR installed.
Notes

Sending a signal set to a task has no effect on that task's state. If a signal set is sent to a blocked task, then the task will remain blocked and the signals will be processed when the task becomes the running task.

Sending a signal set to a global task which does not reside on the local node will generate a request telling the remote node to send the signal set to the specified task.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within interrupt context.
  • The directive may be called from within device driver initialization context.
  • The directive may be called from within task context.
  • When the directive operates on a local object, the directive will not cause the calling task to be preempted.
  • When the directive operates on a remote object, the directive sends a message to the remote node and waits for a reply. This will preempt the calling task.