- 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
:
Содержание Emulator System M3T-MR100
Страница 3: ...M3T MR100 4 V 1 00 User s Manual User s Manual Rev 1 00 2007 09 Real time OS for R32C 100 Series...
Страница 6: ......
Страница 14: ......
Страница 16: ...xii...
Страница 18: ......
Страница 78: ......
Страница 242: ......
Страница 269: ...253 235 entry_address alm2 236 name ID_alm2 237 exinf 0x12345678 238 239 240 241 242 End of Configuration 243...
Страница 279: ...263...
Страница 290: ......
Страница 294: ......
Страница 304: ...288...
Страница 306: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M3T MR100 4 V 1 00 REJ10J1523 0100 User s Manual...