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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.1. KERNEL INTERNAL STATE ACQUISITION FUNCTIONS 263<br />

td ref tsk<br />

Reference Task State<br />

[C Language Interface]<br />

ER ercd = td_ref_tsk ( ID tskid, TD_RTSK *rtsk );<br />

[Parameters]<br />

ID tskid Task ID (TSK SELF can be designated)<br />

TD RTSK rtsk Packet address for returning the task state<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

Normal completion<br />

Bad identifier<br />

Object does not exist<br />

[Description]<br />

Gets the state of the task designated in tskid. This function is similar to tk ref tsk, with the task<br />

start address and stack information added to the state information obtained.<br />

typedef struct td_rtsk {<br />

VP exinf; /* extended information */<br />

PRI tskpri; /* current priority */<br />

PRI tskbpri; /* base priority */<br />

UINT tskstat; /* task state */<br />

UINT tskwait; /* wait factor */<br />

ID wid; /* waiting object ID */<br />

INT wupcnt; /* queued wakeup request count */<br />

INT suscnt; /* SUSPEND request nesting count */<br />

RELTIM slicetime; /* maximum continuous run time (ms) */<br />

UINT waitmask; /* masked wait factors */<br />

UINT texmask; /* allowed task exceptions */<br />

UINT tskevent; /* raised task event */<br />

FP task; /* task start address */<br />

INT stksz; /* user stack size (in bytes) */<br />

INT sstksz; /* system stack size (in bytes) */<br />

VP istack; /* user stack pointer initial value */<br />

VP isstack; /* system stack pointer initial value */<br />

} TD_RTSK;<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!