06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

pSOS+ <strong>System</strong> <strong>Calls</strong> t_mode<br />

t_mode Gets or changes the calling task’s execution mode.<br />

#include <br />

unsigned long t_mode(<br />

unsigned long mask, /* attributes to be changed */<br />

unsigned long new_mode, /* new attributes */<br />

unsigned long *old_mode /* prior mode */<br />

)<br />

Description<br />

Arguments<br />

This system call enables a task to modify certain execution mode fields. These are<br />

preemption on/off, roundrobin on/off, asynchronous signal handling on/off, and<br />

interrupt control.<br />

Preemption has precedence over timeslicing. Therefore, if preemption is off,<br />

timeslicing does not occur whether or not it is set.<br />

The calling task can be preempted as a result of this call, if its preemptibility is<br />

turned from off to on and a higher priority task is ready to run.<br />

To obtain a task's current execution mode without changing it, use a mask of 0.<br />

mask Specifies all task attributes to be modified.<br />

new_mode Specifies the new task attributes.<br />

old_mode Points to the variable where t_mode() stores the old value<br />

of the task’s mode.<br />

You create the arguments mask and new_mode by ORing symbolic constants from<br />

the pairs below. These symbolic constants are also defined in .<br />

T_PREEMPT /<br />

T_NOPREEMPT<br />

T_TSLICE /<br />

T_NOTSLICE<br />

Task is / is not preemptible.<br />

Task can / cannot be time-sliced.<br />

T_ASR / T_NOASR Task's ASR is enabled / disabled.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 1-145<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!