A task's execution mode is a combination of the following four components:
It is used to modify RTEMS' scheduling process and to alter the
execution environment of the task. The data type
rtems_task_mode
is used to manage the task
execution mode.
The preemption component allows a task to determine when control of the
processor is relinquished. If preemption is disabled
(RTEMS_NO_PREEMPT
), the task will retain control of the
processor as long as it is in the executing state -- even if a higher
priority task is made ready. If preemption is enabled
(RTEMS_PREEMPT
) and a higher priority task is made ready,
then the processor will be taken away from the current task immediately and
given to the higher priority task.
The timeslicing component is used by the RTEMS scheduler to determine how
the processor is allocated to tasks of equal priority. If timeslicing is
enabled (RTEMS_TIMESLICE
), then RTEMS will limit the amount
of time the task can execute before the processor is allocated to another
ready task of equal priority. The length of the timeslice is application
dependent and specified in the Configuration Table. If timeslicing is
disabled (RTEMS_NO_TIMESLICE
), then the task will be
allowed to execute until a task of higher priority is made ready. If
RTEMS_NO_PREEMPT
is selected, then the timeslicing
component is ignored by the scheduler.
The asynchronous signal processing component is used to determine when
received signals are to be processed by the task.
If signal processing is enabled (RTEMS_ASR
), then signals
sent to the task will be processed the next time the task executes. If
signal processing is disabled (RTEMS_NO_ASR
), then all
signals received by the task will remain posted until signal processing is
enabled. This component affects only tasks which have established a
routine to process asynchronous signals.
The interrupt level component is used to determine which
interrupts will be enabled when the task is executing.
RTEMS_INTERRUPT_LEVEL(n)
specifies that the task will execute at interrupt level n.
RTEMS_PREEMPT
- enable preemption (default)
RTEMS_NO_PREEMPT
- disable preemption
RTEMS_NO_TIMESLICE
- disable timeslicing (default)
RTEMS_TIMESLICE
- enable timeslicing
RTEMS_ASR
- enable ASR processing (default)
RTEMS_NO_ASR
- disable ASR processing
RTEMS_INTERRUPT_LEVEL(0)
- enable all interrupts (default)
RTEMS_INTERRUPT_LEVEL(n)
- execute at interrupt level n
The set of default modes may be selected by specifying the
RTEMS_DEFAULT_MODES
constant.
Copyright © 1988-2008 OAR Corporation