Renesas M3T-MR100 Network Card User Manual


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