- 76 -
[
[
[
[
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
]
]
]
]
The priority (base priority) of the task specified by tskid is changed to the value indicated by tskpri, and tasks are resched-
uled based on the result of change.
If this service call is executed on a task queued in a ready queue (including a task under execution) or a task in a wait queue
in which tasks are queued in order of priority, the object task is moved to the tail end of the tasks of relevant priority in the
queue. When the same priority as before is specified, the object task is moved to the tail end of that queue also.
The smaller the number, the higher the task priority, with numeral 1 assigned the highest priority. The minimum numeric
value specifiable as priority is 1. Furthermore, the maximum value of priority is the one specified in a configuration file,
and the specifiable range of priority is 1 to 255. For example, if the following statement is written in a configuration file,
system{
stack_size =
0x100;
priority
= 13;
};
then the specifiable range of priority is 1 to 13.
If TSK_SELF is specified, the priority (base priority) of the issuing task is changed. If TSK_SELF is specified for tskid in a
non-task context, the program operation cannot be guaranteed. If TPRI_INI is specified, the priority of a task is changed to
its startup priority specified when it is generated. The changed task priority (base priority) remains effective until the task
terminates or this service call is reexecuted.
If the task indicated by tskid is in an inactive (DORMANT) state, error code E_OBJ is returned as the service call's return
value.
To use these service calls from task contexts, be sure to use chg_pri; to use them from non-task contexts, be sure to use
ichg_pri.
[
[
[
[
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()
{
:
chg_pri( ID_task2, 2 );
:
}
<<Example statement in assembly language>>
.INCLUDE mr100.inc
.GLB
task
task:
:
PUSH.W
R2
PUSH.W
R3
chg_pri #ID_TASK3,#1
:
Содержание 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...