13.4 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.
Define the following items as task information:
The number of task information items that can be specified is defined as being within the range of 1 to 127.
The following shows the task information format.
CRE_TSK ( tskid, { tskatr, exinf, task, itskpri, stksz, stk } );
|
The items constituting the task information are as follows.
Specifies the task name.
An object name can be specified for
tskid.
Note The CF78V4 outputs to the system information header file the correspondence between the task names and IDs, in the following format. Consequently, task names can be used in the place of IDs by including the relevant system information header file using the processing program.
[ Output format to system information header file (for C) ]
[ Output format to system information header file (for assembly language) ]
2 ) Attribute (coding language, initial activation status, initial interrupt status):
tskatr
Specifies the attributes (coding language, initial activation status, initial interrupt status) of the task.
The keywords that can be specified for
tskatr are TA_HLNG, TA_ASM, TA_ACT, TA_ENAINT and TA_DISINT.
TA_HLNG: Start a processing unit through a C language interface.
TA_ASM: Start a processing unit through an assembly language interface.
[ Initial activation status ]
TA_ACT: Task is activated after the creation.
[ Initial interrupt status ]
TA_ENAINT: Enables acknowledgment of maskable interrupts.
TA_DISINT: Disables acknowledgment of maskable interrupts.
Note 1 If specification of TA_ACT is omitted, the initial task activation status is set to the "DORMANT state".
Note 2 If specification of TA_ENAINT and TA_DISINT is omitted, the initial task interrupt status is set to "interrupts acknowledgment enabled".
3 ) Extended information:
exinf
Specifies the extended information of the task.
Values that can be specified for
exinf are from 0 to 1048575, or symbol names written in C.
Note
exinf is passed as an extended information to the target task when the task is activated by
act_tsk or
iact_tsk. The target task can therefore handle
exinf in the same manner as handling function parameters.
Specifies the start address of the task.
Values that can be specified for
task are symbol names written in C.
Note 1 When a task is in written in C as shown below, the value specified by this item is "func_task".
#include <kernel.h>
#include <kernel_id.h>
void
func_task ( VP_INT exinf )
{
/* ............ */
ext_tsk ( );
}
|
Note 2 When a task is in written in assembly language as shown below, the value specified by this item is "func_task".
$INCLUDE (kernel.inc)
$INCLUDE (kernel_id.inc)
.PUBLIC _func_task
.SECTION .text, TEXT
_func_task:
PUSH BC
PUSH AX
; ............
BR !!_ext_tsk
|
5 ) Initial priority:
itskpri
Specifies the initial priority of the task.
Values that can be specified for
itskpri are limited to "1 to
Priority range: maxtpri".
Specifies the stack size (in bytes) of the task.
A value between 0 and 65534, aligned to a 2-byte boundary, can be specified for
stksz.
Note 1 The task stack is allocated to the .kernel_stack section.
7 ) System-reserved area:
stk
System-reserved area.
Values that can be specified for
stk are limited to NULL characters.