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.

230 CHAPTER 5. T-KERNEL/SM<br />

TD NOLOCK Lock (making resident) not necessary<br />

Indicates that a memory space (buf) designated in IO operations (tk rea dev and tk wri dev)<br />

has already been locked (made resident) on the calling side and does not have to be locked<br />

by the device driver. In this case the device driver does not (must not) lock the area. One<br />

use of this designation is to perform disk access for page in/page out in a virtual memory<br />

system. Generally it does not have to be designated.<br />

The device descriptor belongs to the resource group of the task that opened the device.<br />

When a physical device is opened, the logical devices belonging to it are all treated as having been<br />

opened in the same mode, and are processed as exclusive open.<br />

E BUSY<br />

E NOEXS<br />

E LIMIT<br />

Other<br />

Device busy (exclusive open)<br />

Device does not exist<br />

Open count exceeds the limit<br />

Errors returned by device driver<br />

• ER tk_cls_dev( ID dd, UINT option )<br />

dd<br />

option<br />

return code<br />

Device descriptor<br />

Close option<br />

Error<br />

Closes device descriptor dd.<br />

If a request is being processed, the processing is aborted and the device is closed.<br />

option := [TD_EJECT]<br />

#define TD_EJECT 0x0001 /* eject media */<br />

TD EJECT Eject media<br />

If the same device has not been opened by another task, the media is ejected. In the case of<br />

devices that cannot eject their media, the request is ignored.<br />

The subsystem cleanup processing (tk cln ssy) closes all the device descriptors belonging to the<br />

resource group.<br />

E ID<br />

Other<br />

dd is invalid or not open<br />

Errors returned by device driver<br />

• ID tk_rea_dev( ID dd, INT start, VP buf, INT size, TMO tmout )<br />

dd<br />

start<br />

buf<br />

size<br />

tmout<br />

return code<br />

Device descriptor<br />

Read start location (≥ 0: Device-specific data, < 0: Attribute data)<br />

Buffer location for putting the read data<br />

Read size<br />

Request acceptance timeout (ms)<br />

Request ID or error<br />

Starts reading device-specific data or attribute data from the designated device. This function<br />

starts reading only, returning to its caller without waiting for the read operation to finish. The<br />

space designated in buf must be retained until the read operation completes. Read completion is<br />

waited for by tk wai dev.<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!