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.

42 CHAPTER 4. T-KERNEL/OS FUNCTIONS<br />

tk set tsp<br />

Set Task Space<br />

[C Language Interface]<br />

ER ercd = tk_set_tsp ( ID tskid, T_TSKSPC *pk_tskspc ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

T TSKSPC tskspc Task space<br />

typedef struct t_tskspc {<br />

VP uatb; Task space page table address<br />

INT lsid; Task space ID (logical space ID)<br />

} T_TSKSPC;<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E PAR<br />

Normal completion<br />

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

Object does not exist (the task designated in tskid does not exist)<br />

Parameter error (pk tskspc is invalid or cannot be used)<br />

[Description]<br />

Sets the task space of the task designated in tskid.<br />

The invoking task can be designated by setting tskid = TSK SELF = 0. Note, however, that when a<br />

system call is issued from a task-independent portion and tskid = TSK SELF = 0 is designated, error<br />

code E ID is returned.<br />

The OS is not aware of the effects of task space changes. If, for example, a task space is changed<br />

while a task is using it for its execution, the task may hang or encounter other problems. The caller is<br />

responsible for avoiding such problems.<br />

[Additional Notes]<br />

The accuracy of T TSKSPC (uatb, lsid) designation is implementation-dependent, but the above definitions<br />

should be followed to the extent possible.<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!