Renesas M3T-MR100 Network Card User Manual


 
- 170 -
[
[
[
[
F
F
u
u
n
n
c
c
t
t
i
i
o
o
n
n
a
a
l
l
d
d
e
e
s
s
c
c
r
r
i
i
p
p
t
t
i
i
o
o
n
n
]
]
]
]
This service call rotates the ready queue whose priority is indicated by tskpri. In other words, it relocates the task enqueued
at the top of the ready queue of the specified priority by linking it to behind the tail of the ready queue, thereby switching
over the executed tasks that have the same priority. Figure 5-1 depicts the manner of how this is performed.
Proprity 1
Priority 2
Priority n
TCB
TCB TCB
TCB TCB TCB
Moved to behind the tail of the queue
Figure 5-1. Manipulation of the ready queue by the rot_rdq service call
By issuing this service call at given intervals, it is possible to perform round robin scheduling. If tskpri=TPRI_SELF is
specified when using the rot_rdq service call, the ready queue whose priority is that of the issuing task is rotated.
TPRI_SELF cannot be specified in the irot_rdq service call. TPRI_SELF cannot be specified by irot_rdq service call.
However, an error is not returned even if it is specified.
If the priority of the issuing task itself is specified in this service call, the issuing task is relocated to behind the tail of the
ready queue in which it is enqueued. Note that if the ready queue of the specified priority has no tasks in it, no operation is
performed.
If this service call is to be issued from task context, use rot_rdq; if issued from non-task context, use irot_rdq.
[
[
[
[
E
E
x
x
a
a
m
m
p
p
l
l
e
e
p
p
r
r
o
o
g
g
r
r
a
a
m
m
s
s
t
t
a
a
t
t
e
e
m
m
e
e
n
n
t
t
]
]
]
]
<<Example statement in C language>>
#include <itron.h>
#include <kernel.h>
#include “kernel_id.h”
void task()
{
:
rot_rdq( 2 );
:
}
<<Example statement in assembly language>>
.include mr100.inc
.GLB task
task:
:
PUSH.W R3
rot_rdq #2
: