Renesas M3T-MR100 用户手册

下载
页码 304
   
- 37 - 
 
4.1.3 
Task Management Function 
The task management function is used to perform task operations such as task start/stop and task priority updating. The 
MR100 kernel offers the following task management function service calls. 
• 
Activate Task (act_tsk, iact_tsk) 
Activates the task, changing its status from DORMANT to either READY or RUNNING. In this service call, un-
like in sta_tsk(ista_tsk), startup requests are accumulated, but startup code cannot be specified. 
• 
Activate Task (sta_tsk, ista_tsk) 
Activates the task, changing its status from DORMANT to either READY or RUNNING. In this service call, un-
like in act_tsk(iact_tsk), startup requests are not accumulated, but startup code can be specified. 
• 
Terminate Invoking Task (ext_tsk) 
When the issuing task is terminated, its state changes to DORMANT state. The task is therefore not executed until 
it is restarted. If startup requests are accumulated, task startup processing is performed again. In that case, the is-
suing task behaves as if it were reset. 
If written in C language, this service call is automatically invoked at return from the task regardless of whether it 
is explicitly written when terminated. 
• 
Terminate Task (ter_tsk) 
Other tasks in other than DORMANT state are forcibly terminated and placed into DORMANT state. If startup 
requests are accumulated, task startup processing is performed again. In that case, the task behaves as if it was re-
set.  (See Figure 4.2)
 
TaskA 
TaskB 
ter_tsk(B)
     
Task B reset 
Terminated
Startup request count > 0
 
Figure 4.2 Task Resetting 
• 
Change Task Priority (chg_pri, ichg_pri) 
If the priority of a task is changed while the task is in READY or RUNNING state, the ready queue also is up-
dated. (See Figure 4.3
). 
Furthermore, if the target task is placed in a waiting queue of objects with TA_TPRI attribute, the waiting queue 
also is updated.    (See Figure 4.4
).