cre_cyc

acre_cyc

Outline

Create cyclic handler.

C format

 ER      cre_cyc (ID cycid, T_CCYC *pk_ccyc );
 ER_ID   acre_cyc ( T_CCYC *pk_ccyc );
Parameter(s)

I/O

Parameter

Description

I

 ID      cycid;
ID number of the cyclic handler.

I

 T_CCYC  *pk_ccyc;
Pointer to the packet containing the cyclic handler creation information.



[Cyclic handler creation information packet : T_CCYC]

 typedef struct  t_ccyc {
     ATR     cycatr;         /*Cyclic handler attribute*/
     VP_INT  exinf;          /*Extended information*/
     FP      cychdr;         /*Cyclic handler start address*/
     RELTIM  cyctim;         /*Activation cycle (in milli-second)*/
     UINT    cycphs;         /*Activation phase (in milli-second)*/
 } T_CCYC;


Explanation

This service call can be called from tasks that belong to Trusted Domain.

The cre_cyc creates a cyclic handler with cyclic handler ID indicated by cycid according to the content of pk_ccyc. The acre_cyc creates a cyclic handler according to the content of pk_ccyc, and returns the created cyclic handler ID.

1 ) Cyclic handler attribute (cycatr)
The following are specified for cycatr.


   cycatr := ( TA_HLMG | [ TA_STA ] | [ TA_PHS ] )
- TA_HLNG ( = 0x0000)
Only C-language is supported for cyclic handler description language.


- TA_STA ( = 0x0002)
When TA_STA is specified, the cyclic handler is in operational state (STA state). When TA_STA is not specified, the cyclic handler is in non-operational state (STP state).


- TA_PHS ( = 0x0004)
When TA_PHS is specified, the next activation time is determined preserving the activation phase when the cyclic handler is moved to operational state. When TA_PHS is not specified, the cyclic handler is activated cyctim milliseconds after issuing sta_cyc or ista_cyc.
Please refer to "10.6.5 Start cyclic handler operation".



2 ) Extended information (exinf)
The exinf is passed to the cyclic handler as argument. The exinf can be widely used by the user, for example, to set information concerning the cyclic handler.


3 ) Cyclic handler start address (cychdr)
Specify the cyclic handler start address for cychdr.


4 ) Activation cycle (cyctim), activation phase (cycphs)
Specify activation cycle (in milli-second) for cyctim.
And specify the time to the first staring from this service call (in milli-second) for cycphs. When both TA_STA and TA_PHS are not specified, the cycphs is ignored.



Return value

Macro

Value

Description

-

Positive value

Normal completion of acre_cyc. (Created cyclic handler ID)

E_OK

0

Normal completion of cre_cyc.

E_RSATR

-11

Reserved attribute

- Either of bits in cycatr except bit1 and bit2 is 1.

E_PAR

-17

Parameter error.

- pk_ccyc == NULL

- cychdr == NULL

- cyctim == 0, cyctim > (0x7FFFFFFF - TIC_NUME) / TIC_DENO

- cyctim < cycphs

E_ID

-18

Invalid ID number. (only for cre_cyc)

- cycid < 0

- cycid > VTMAX_CYH

E_CTX

-25

Context error.

- 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".

E_MACV

-26

Memory access violation.

- Stack pointer points out of user stack for invoking task.

- The operand-read access to the area indicated by pk_ccyc has not been permitted to the invoking task.

E_OACV

-27

Object access violation.

- The invoking task does not belong to trusted domain.

E_NOID

-34

No ID number available.(only for acre_cyc)

E_OBJ

-41

Object state error. (only for cre_cyc)

- The cyclic handler specified by cycid exists.