17.5 Static API Information
The following describes the format that must be observed when describing the static API information in the system configuration file.

The GOTHIC-FONT characters in following descriptions are the reserved words, and italic face characters are the portion that the user must write the relevant numeric value, symbol name, or keyword.

Items enclosed by square brackets "[ ]" can be omitted.

17.5.1 Task information

The task information defines ID number: tskid, Attribute: tskatr, Extended information: exinf, Start address: task, Initial priority: itskpri, Task stack size: stksz, memory area name: sec_nam, Reserved for future use: stk for a task.

The number of items that can be defined as task information is limited to one for each ID number.

The following shows the task information format.

 CRE_TSK (tskid, { tskatr, exinf, task, itskpri, stksz[:sec_nam], stk });
sec_nam

The items constituting the task information are as follows.

1 ) ID number: tskid

Specifies the ID number for a task.
A value from 0x1 to 0xff, or a name, can be specified for tskid.


Note When a name is specified, the CF850V4 automatically assigns an ID number.
The CF850V4 outputs the relationship between a name and an ID number to the system information header file in the following format:


 #define tskid   value
2 ) Attribute: tskatr

Specifies the attribute for a task.
The keyword that can be specified for tskatr is TA_HLNG, TA_ASM, TA_ACT, TA_DISPREEMPT, TA_ENAINT and TA_DISINT.


[Coding language]

TA_HLNG: Start a task through a C language interface.

TA_ASM: Start a task through an assembly language interface.

[Initial activation state]

TA_ACT: Task is activated after the creation.

[Initial preemption state]

TA_DISPREEMPT: Preemption is disabled at task activation.

[Initial interrupt state]

TA_ENAINT: Acceptance of EI level maskable interrupts (from the Maximum interrupt priority: maxintpri to the minimum interrupt priority) is enabled.

TA_DISINT: Acceptance of EI level maskable interrupts (from the Maximum interrupt priority: maxintpri to the minimum interrupt priority) is disabled.

Note 1 If specification of TA_ACT is omitted, the DORMANT state is specified as the initial activation state.

Note 2 If specification of TA_DISPREEMPT is omitted, preempt acceptance is enabled.

Note 3 If specifications of TA_ENAINT and TA_DISINT are omitted, EI level maskable interrupts (from the Maximum interrupt priority: maxintpri to the minimum interrupt priority) are enabled in the initial state.

3 ) Extended information: exinf

Specifies the extended information for a task.
A value from 0x0 to 0xffffffff, or a symbol name, can be specified for exinf.


Note The target task can be manipulated by handling the extended information as if it were a function parameter.

4 ) Start address: task

Specifies the start address for a task.
A value from 0x0 to 0xfffffffe (aligned to a 2-byte boundary), or a symbol name, can be specified for task.


Note When a task is coded as follows, the symbol name specified for task should be func_task.

 #include        <kernel.h>
 #include        <kernel_id.h>
 
 void
 func_task ( VP_INT exinf )
 {
         ............
         ............
 
         ext_tsk ( );
 }


5 ) Initial priority: itskpri

Specifies the initial priority for a task.
A value from "0x1 to Maximum priority: maxtpri defined in the Basic information" can be specified for itskpri.


6 ) Task stack size: stksz, memory area name: sec_nam

Specifies the task stack size (unit: bytes) and the name of the memory area secured for the task stack.
Only 4-byte boundary values from 0x0 to 0x7ffffffc can be specified for stksz, and only memory area name sec_nam defined in Memory area information" can be specified for sec_nam.


Note 1 If specification of sec_nam is omitted, the task stack is allocated to ".kernel_work" section.

Note 2 The stack size that is actually secured is calculated as the specified stack size plus "ctxsz (size of context area of interrupt handler)". See 2 Task stack for details about ctxsz.

7 ) Reserved for future use: stk

System-reserved area.
Values that can be specified for stk are limited to NULL characters.