Signals in GeMRTOS

Signals in GeMRTOS #

Signals in operating systems handle exceptional conditions that may happen during runtime. Signals allow tasks to execute associated code when a certain condition takes place. Some of these conditions may be defined, for instance, as when a task is created, a resource is granted or a task is blocked. In GeMRTOS, the GS_SCB data structure is defined to store the signal information and it is linked to data structures accordingly. The GS_SCB data structure points to the code to be executed when the condition of the signal occurs. This code is executed prior to the execution of the code of the task with which the signal is associated. In GeMRTOS, there exist different signal types.

Todo:
Define the rest of SCB types

Types of GeMRTOS scheduling lists #

The following are the type of signals in GeMRTOS, but more can be defined:

G_SCBType_TCB_ABORTED

The G_SCBType_TCB_ABORTED signal type is defined to signaling when a task is aborted. A task aborting happens when a new release of a periodic task takes place before the previos invokation completes. The associated abortion function will be executed prior the execution of the next instance of the task.

Main signal related functions #

Creating and initializing a signal #

GS_SCB * gu_signal_create (INT32 Type, INT32 Priority, void * pxcb, void * Signal_Code, void * Signal_Arg )

The gu_signal_create function creates and associates a type signal to a task. The priority given to the signal created determines the execution order when there exist more than a signal code to be executed.

The signal is created with the following parameters:

TypeIt is the signal type to be associated with. It is the name of the signal type, for instance: G_SCBType_TCB_ABORTED.
PriorityIt is the priority given to the signal create and determines the execution order when more than one signal code has to be executed.
pxcbIt is the control structure to link the signal created. This control structure may be resources, processors, tasks, or events.
Signal_CodeIt is a pointer to the function that imlpements the signal code: i.e. the function name of the signal.
Signal_ArgIt is the argument to pass to the signal function when it is executed.
Returns
The gu_signal_create function returns a pointer to the GS_SCB structure created.