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.

TPRI_SELF: Current priority of the invoking task.

Value: Priority of the tasks.



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 RI600PX'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.


Note 4 As for a task which has locked mutexes, the current priority might be different from the base priority. In this case, even if the task issues this servie call specifying TPRI_SELF for parameter tskpri, the ready queue of the current priority that the invoking task belongs cannot be changed.

Note 5 For current priority and base priority, refer to "8.2.2 Current priority and base priority".

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- tskpri < 0

- tskpri > TMAX_TPRI

- 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.

- The irot_rdq was issued from task.

- The rot_rdq was issued from non-task.

- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".

E_MACV

-26

Memory access violation. (only for rot_rdq)

- Stack pointer points out of user stack for invoking task.