RTEMS Logo

RTEMS 4.10.0 On-Line Library


Task Manager TASK_MODE - Change the current task mode

PREV UP NEXT Bookshelf RTEMS Ada User's Guide

5.4.11: TASK_MODE - Change the current task mode

CALLING SEQUENCE:

procedure Task_Mode (
   Mode_Set          : in     RTEMS.Mode;
   Mask              : in     RTEMS.Mode;
   Previous_Mode_Set : in     RTEMS.Mode;
   Result            :    out RTEMS.Status_Codes
);

DIRECTIVE STATUS CODES:

RTEMS.SUCCESSFUL - task mode set successfully
RTEMS.INVALID_ADDRESS - previous_mode_set is NULL

DESCRIPTION:

This directive manipulates the execution mode of the calling task. A task's execution mode enables and disables preemption, timeslicing, asynchronous signal processing, as well as specifying the current interrupt level. To modify an execution mode, the mode class(es) to be changed must be specified in the mask parameter and the desired mode(s) must be specified in the mode parameter.

NOTES:

The calling task will be preempted if it enables preemption and a higher priority task is ready to run.

Enabling timeslicing has no effect if preemption is disabled. For a task to be timesliced, that task must have both preemption and timeslicing enabled.

A task can obtain its current execution mode, without modifying it, by calling this directive with a mask value of RTEMS.CURRENT_MODE.

To temporarily disable the processing of a valid ASR, a task should call this directive with the RTEMS.NO_ASR indicator specified in mode.

The set of task mode constants and each mode's corresponding mask constant is provided in the following table:

Mode Constant Mask Constant Description
RTEMS.PREEMPT RTEMS.PREEMPT_MASK enables preemption
RTEMS.NO_PREEMPT RTEMS.PREEMPT_MASK disables preemption
RTEMS.NO_TIMESLICE RTEMS.TIMESLICE_MASK disables timeslicing
RTEMS.TIMESLICE RTEMS.TIMESLICE_MASK enables timeslicing
RTEMS.ASR RTEMS.ASR_MASK enables ASR processing
RTEMS.NO_ASR RTEMS.ASR_MASK disables ASR processing
RTEMS.INTERRUPT_LEVEL(0) RTEMS.INTERRUPT_MASK enables all interrupts
RTEMS.INTERRUPT_LEVEL(n) RTEMS.INTERRUPT_MASK sets interrupts level n


PREV UP NEXT Bookshelf RTEMS Ada User's Guide

Copyright © 1988-2008 OAR Corporation