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.

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

tk cre res<br />

Create Resource Group<br />

[C Language Interface]<br />

ID resid = tk_cre_res ( ) ;<br />

[Parameters]<br />

None<br />

[Return Parameters]<br />

ID resid Resource ID<br />

or Error Code<br />

[Error Codes]<br />

E OK<br />

E LIMIT<br />

E NOMEM<br />

Normal completion<br />

Number of resource groups exceeds the system limit<br />

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

[Description]<br />

Creates a new resource group, assigning to it a resource control block and resource ID.<br />

Resource IDs are assigned in common for the entire system. A separate resource control block is created<br />

for each subsystem (see Figure 4.15).<br />

Resource ID<br />

#1 #2 #3<br />

Subsystem A<br />

Subsystem B<br />

Subsystem C<br />

ResBlk ResBlk ResBlk<br />

ResBlk ResBlk ResBlk<br />

ResBlk ResBlk ResBlk<br />

Figure 4.15: Subsystems and Resource Groups<br />

In some cases a new subsystem will be defined when a resource group is already created. Even in such<br />

a case, it is necessary to create a resource control block of an already existing resource group for the<br />

newly registered subsystem. In other words, there may be cases where resource control block creation<br />

must be performed by tk def ssy. For example, if a new subsystem ID is defined in a situation like that<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!