In general, an ASR's mode is built by a bitwise OR of the desired mode components. The set of valid mode components is the same as those allowed with the task_create and task_mode directives. A complete list of mode options is provided in the following table:
RTEMS_PREEMPT is masked by
RTEMS_PREEMPT_MASK and enables preemption
RTEMS_NO_PREEMPT is masked by
RTEMS_PREEMPT_MASK and disables preemption
RTEMS_NO_TIMESLICE is masked by
RTEMS_TIMESLICE_MASK and disables timeslicing
RTEMS_TIMESLICE is masked by
RTEMS_TIMESLICE_MASK and enables timeslicing
RTEMS_ASR is masked by
RTEMS_ASR_MASK and enables ASR processing
RTEMS_NO_ASR is masked by
RTEMS_ASR_MASK and disables ASR processing
RTEMS_INTERRUPT_LEVEL(0) is masked by
RTEMS_INTERRUPT_MASK and enables all interrupts
RTEMS_INTERRUPT_LEVEL(n) is masked by
RTEMS_INTERRUPT_MASK and sets interrupts level n
Mode values are specifically designed to be mutually exclusive, therefore bitwise OR and addition operations are equivalent as long as each mode appears exactly once in the component list. A mode component listed as a default is not required to appear in the mode list, although it is a good programming practice to specify default components. If all defaults are desired, the mode DEFAULT_MODES should be specified on this call.
This example demonstrates the mode parameter used
with the rtems_signal_catch
to establish an ASR which executes at
interrupt level three and is non-preemptible. The mode should
be set to
RTEMS_INTERRUPT_LEVEL(3) | RTEMS_NO_PREEMPT
to indicate the
desired processor mode and interrupt level.
Copyright © 1988-2004 OAR Corporation