-
cre_tsk
acre_tsk
-
ER cre_tsk (ID tskid, T_CTSK *pk_ctsk );
ER_ID acre_tsk ( T_CTSK *pk_ctsk );
|
|
|
|
ID tskid;
|
|
|
T_CTSK *pk_ctsk;
|
Pointer to the packet containing the task creation information.
|
[Task creation information packet : T_CTSK]
typedef struct t_ctsk {
ATR tskatr; /*Task attribute*/
VP_INT exinf; /*Extended information*/
FP task; /*Task start address*/
PRI itskpri; /*Task initial priority*/
SIZE stksz; /*User stack size (in bytes)*/
VP stk; /*Start address of user stack*/
} T_CTSK;
|
This service call can be called from tasks that belong to
Trusted Domain.
The cre_tsk creates a task with task ID indicated by
tskid according to the content of
pk_ctsk. The acre_tsk creates a task
according to the content of
pk_ctsk, and returns the created task ID.
The processing performed at task creation is shown in
Table 19-2.
Table 19-2 Processing Performed at Task Creation
|
|
|
Clears the number of queued activation requests.
|
|
Resets the task state so that the task exception handling routine is not defined.
|
1 ) Task attribute (
tskatr)
The following are specified for
tskatr.
tskatr := ( TA_HLNG | [TA_ACT] | [TA_DOMdomid] )
The bit position of tskatr is shown as follows.
-
TA_HLNG ( = 0x0000)
Only C-language is supported for task description language.
-
TA_ACT ( = 0x0002)
When the TA_ACT attribute is specified, the created task makes a transition to the READY state. The processing performed at task activation is shown in
Table 19-3. When the TA_ACT attribute is not specified, the created task makes a transition to the DORMANT state.
- TA_DOM(
domid)
The created task belong to the domain indicated by
domid. When 0 is specified for
domid or TA_DOM(domid) is not specified, the created task belongs to the domain that the invoking task belong to.
2 ) Extended information (
exinf)
When the task is activated by TA_ACT attribute, act_tsk or iact_tsk,
exinf is passed to the task as argument. And
exinf is passed to the task exception handling routine. The
exinf can be widely used by the user, for example, to set information concerning the task.
3 ) Task start address (
task)
Specify the task start address for
task.
4 ) Task initial priority (
itskpri)
Specify initial priority of the task for
itskpri. Ranges of the value that can be specified are from 1 to
TMAX_TPRI.
5 ) User stack size (
stksz), Start address of user stack (
stk)
The application acquires user stack area, and specifies the start address for
stk and the size for
stksz.
The user stack area must satisfy the following.
A ) The
stk must be 16-bytes boundary. If not, error E_PAR is returned.
B ) The
stksz must be multiple of 16. If not, error E_PAR is returned.
C ) The user stack area must not overwrap with either all user stacks and all memory objects. If not, an error is not detected and correct system operation cannot be guaranteed.
Note The
mITRON4.0 specification defines the function that the kernel allocates user stack area when NULL is specified for
stk. But RI600PX does not support this function.
|
|
|
|
|
Normal completion of acre_tsk. (Created task ID)
|
|
|
Normal completion of cre_tsk.
|
|
|
- Either bit0, bit2, bit3 or bit8-15 in tskatr is 1.
|
|
|
- stk is not 16-bytes boundary.
- stksz is not multiple of 16.
- stksz < (lower bound value described in Table 20-8
- stk + stksz > 0x100000000
|
|
|
Invalid ID number. (only for cre_tsk)
|
|
|
- This service call was issued in the CPU locked state.
- This service call was issued from non-task.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
|
|
|
- Stack pointer points out of user stack for invoking task.
- The operand-read access to the area indicated by pk_ctsk has not been permitted to the invoking task.
|
|
|
- The invoking task does not belong to trusted domain.
|
|
|
|
|
|
No ID number available.(only for acre_tsk)
|
|
|
Object state error. (only for cre_tsk)
- The task specified by tskid exists.
|