sus_tsk

isus_tsk

Outline

Suspend task.

C format

 ER      sus_tsk ( ID tskid );
 
 ER      isus_tsk ( ID tskid );


Assembly format

 MOV     A, #tskid
 CALL    !!_sus_tsk
 
 MOV     A, #tskid
 CALL    !!_isus_tsk


Parameter(s)

I/O

Parameter

Description

I

 ID      tskid;
ID number of the task to be suspended.

TSK_SELF: Invoking task.

Value: ID number of the task to be suspended.



Explanation

These service calls add 0x1 to the suspend request counter for the task specified by parameter tskid, and then move the target task from the RUNNING state to the SUSPENDED state, from the READY state to the SUSPENDED state, or from the WAITING state to the WAITING-SUSPENDED state.

If the target task has moved to the SUSPENDED or WAITING-SUSPENDED state when this service call is issued, the counter manipulation processing is not performed but only the suspend request counter increment processing is executed.

SUSPENDED State Cancel Operation

Return Value

A cancel request was issued as a result of issuing rsm_tsk.

E_OK

A cancel request was issued as a result of issuing irsm_tsk.

E_OK

Forced release from suspended (accept frsm_tsk while suspended).

E_OK

Forced release from suspended (accept ifrsm_tsk while suspended).

E_OK



Note 1 If the target task is the invoking task when this service call is issued, it is unlinked from the ready queue and excluded from the RI78V4 scheduling subject.

Note 2 The suspend request counter managed by the RI78V4 is configured in 7-bit widths. If the number of suspend requests exceeds the maximum count value 127 as a result of issuing this service call, the counter manipulation processing is therefore not performed but "E_QOVR" is returned.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_OBJ

-41

Object state error (specified task is in the DORMANT state).

E_QOVR

-43

Queue overflow (overflow of suspension count "127").