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-2007OAR Corporation