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.10. SUBSYSTEM MANAGEMENT FUNCTIONS 211<br />

tk sta ssy<br />

tk cln ssy<br />

Call Startup Function of Sub-System<br />

Call Cleanup Function of Sub-System<br />

[C Language Interface]<br />

ER ercd = tk_sta_ssy ( ID ssid, ID resid, INT info ) ;<br />

ER ercd = tk_cln_ssy ( ID ssid, ID resid, INT info ) ;<br />

[Parameters]<br />

ID ssid Subsystem ID<br />

ID resid Resource ID<br />

INT info Any parameter<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E CTX<br />

Normal completion<br />

Invalid ID number (ssid or resid is invalid or cannot be used)<br />

Object does not exist (the subsystem designated in ssid is not defined)<br />

Context error (issued from task-independent portion or in dispatch disabled state)<br />

[Description]<br />

Calls the startup function/cleanup function of the subsystem designated in ssid.<br />

A designation of ssid = 0 makes the system call applicable to all currently defined subsystems. In this<br />

case the startup/cleanup functions of each subsystem are called in sequence.<br />

tk sta ssy: Calls in order starting from the highest subsystem priority.<br />

tk cln ssy: Calls in order starting from the lowest subsystem priority.<br />

The order among subsystems having the same priority is not defined.<br />

If there are dependency relationships among different subsystems, the subsystem priority must therefore<br />

be set with those relationships in mind. If, for example, subsystem B uses functions in subsystem A,<br />

then the priority of subsystem A must be set higher than that of subsystem B.<br />

Even if these system calls are issued for a subsystem with no startup function or cleanup function<br />

defined, those functions are simply not called; no error results.<br />

If during startup/cleanup function execution a task exception is raised for the task that called tk sta ssy<br />

or tk cln ssy, the task exception is held until the startup/cleanup function completes its processing.<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!