30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.7. TIME MANAGEMENT FUNCTIONS 177<br />

tk cre alm<br />

Create Alarm Handler<br />

[C Language Interface]<br />

ID almid = tk_cre_alm ( T_CALM *pk_calm ) ;<br />

[Parameters]<br />

T CALM* pk calm Address of alarm handler definition packet<br />

pk calm detail:<br />

VP exinf Extended information<br />

ATR almatr Alarm handler attributes<br />

FP almhdr Alarm handler address<br />

[Return Parameters]<br />

ID almid Alarm handler ID<br />

or Error Code<br />

[Error Codes]<br />

E OK<br />

E NOMEM<br />

E LIMIT<br />

E RSATR<br />

E PAR<br />

Normal completion<br />

Insufficient memory (memory for control block cannot be allocated)<br />

Number of alarm handlers exceeds the system limit<br />

Reserved attribute (almatr is invalid or cannot be used)<br />

Parameter error (almno, pk calm, or almhdr is invalid or cannot be used)<br />

[Description]<br />

Creates an alarm handler, assigning to it an alarm handler ID. An alarm handler is a handler running<br />

at the designated time as a task-independent portion.<br />

exinf can be used freely by the user to set miscellaneous information about the created alarm handler.<br />

The information set in this parameter can be referenced by tk ref alm. If a larger area is needed for<br />

indicating user information, or if the information may need to be changed after the alarm handler is<br />

created, this can be done by allocating separate memory for this purpose and putting the memory packet<br />

address in exinf. The OS pays no attention to the contents of exinf.<br />

almatr indicates system attributes in its low bits and implementation-dependent information in the<br />

high bits. Designation in the system attributes part of almatr is as follows.<br />

almatr := (TA_ASM || TA_HLNG)<br />

TA ASM<br />

TA HLNG<br />

The handler is written in assembly language<br />

The handler is written in high-level language<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!