Everything

rot_rdq

irot_rdq

Outline
Rotate task precedence.
C format
 ER      rot_rdq (PRI tskpri);
 ER      irot_rdq (PRI tskpri);
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 RI850V4'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.
E_PAR
-17
Parameter error.
- tskpri < 0x0
- tskpri > Maximum priority
- When this service call was issued from a non-task, TPRI_SELF was specified tskpri.
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.