rot_rdq

irot_rdq

Outline

Rotate task precedence.

C format

 ER      rot_rdq ( PRI tskpri );
 
 ER      irot_rdq ( PRI tskpri );


Assembly format

 MOV     A, #tskpri
 CALL    !!_rot_rdq
 
 MOV     A, #tskpri
 CALL    !!_irot_rdq


Parameter(s)

I/O

Parameter

Description

I

 PRI     tskpri;
Priority of the tasks whose precedence is rotated.

TPRI_SELF: Current priority of the invoking task.

Value: Priority of the tasks whose precedence is rotated.



Explanation

This service call re-queues the first task of the ready queue corresponding to the priority specified by parameter tskpri to the end of the queue to change the task execution order explicitly.

Note 1 This service call does not perform queuing of rotation requests. If no task is queued to the ready queue corresponding to the relevant priority, therefore, no processing is performed but it is not handled as an error.

Note 2 Round-robin scheduling can be implemented by issuing this service call via a cyclic handler in a constant cycle.

Note 3 The ready queue is a hash table that uses priority as the key, and tasks that have entered an executable state (READY state or RUNNING state) are queued in FIFO order.
Therefore, the scheduler realizes the RI78V4's Scheduling System by executing task detection processing from the highest priority level of the ready queue upon activation, and upon detection of queued tasks, giving the CPU use right to the first task of the proper priority level.


Return value

Macro

Value

Description

E_OK

0

Normal completion.