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 265<br />

td ref sem, td ref flg, td ref mbx, td ref mtx<br />

td ref mbf, td ref por, td ref mpf, td ref mpl<br />

td ref cyc, td ref alm, td ref ssy<br />

Reference Queue<br />

[C Language Interface]<br />

ER ercd = td_ref_sem ( ID semid, TD_RSEM *rsem ); /* semaphore */<br />

ER ercd = td_ref_flg ( ID flgid, TD_RFLG *rflg ); /* event flag */<br />

ER ercd = td_ref_mbx ( ID mbxid, TD_RMBX *rmbx ); /* mailbox */<br />

ER ercd = td_ref_mtx ( ID mtxid, TD_RMTX *rmtx ); /* mutex */<br />

ER ercd = td_ref_mbf ( ID mbfid, TD_RMBF *rmbf ); /* message buffer */<br />

ER ercd = td_ref_por ( ID porid, TD_RPOR *rpor ); /* rendezvous port */<br />

ER ercd = td_ref_mpf ( ID mpfid, TD_RMPF *rmpf ); /* fixed-size memory pool */<br />

ER ercd = td_ref_mpl ( ID mplid, TD_RMPL *rmpl ); /* variable-size memory pool */<br />

ER ercd = td_ref_cyc ( ID cycid, TD_RCYC *rcyc ); /* cyclic handler */<br />

ER ercd = td_ref_alm ( ID almid, TD_RALM *ralm ); /* alarm handler */<br />

ER ercd = td_ref_ssy ( ID ssid, TD_RSSY *rssy ); /* subsystem */<br />

[Parameters]<br />

ID —id Object ID<br />

TD R— r— Address of status information packet<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 status of an object. This is similar to tk ref —. The return packets are defined as follows.<br />

/*<br />

*Semaphore status information td_ref_sem<br />

*/<br />

typedef struct td_rsem {<br />

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

ID wtsk; /* waiting task ID */<br />

INT semcnt; /* current semaphore count */<br />

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