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.

5.3. DEVICE MANAGEMENT FUNCTIONS 235<br />

E QOVR Suspend disable request count limit exceeded<br />

• ID tk_get_dev( ID devid, UB *devnm )<br />

devid<br />

devnm<br />

return code<br />

Device ID<br />

Device name storage location<br />

Device ID of physical device or error<br />

Gets the device name of the device designated in devid and puts the result in devnm.<br />

devid is the device ID of either a physical device or a logical device. If devid is a physical device,<br />

the physical device name is put in devnm. If devid is a logical device, the logical device name is<br />

put in devnm. devnm requires a space of L DEVNM + 1 bytes or larger.<br />

The device ID of the physical device to which device devid belongs is passed in the return code.<br />

E NOEXS<br />

The device designated in devid does not exist<br />

• ID tk_ref_dev( UB *devnm, T_RDEV *rdev )<br />

• ID tk_oref_dev( ID dd, T_RDEV *rdev )<br />

devnm<br />

dd<br />

rdev<br />

return code<br />

Device name<br />

Device descriptor<br />

Device information<br />

Device ID or error<br />

typedef struct t_rdev {<br />

ATR devatr; /* device attributes */<br />

INT blksz; /* block size of device-specific data (-1: unknown) */<br />

INT nsub; /* subunit count */<br />

INT subno; /* 0: physical device: 1 to nsub: subunit number+1 */<br />

/* Implementation-dependent information may be added beyond this point.*/<br />

} T_RDEV;<br />

Gets device information about the device designated in devnm or dd and puts the result in rdev.<br />

If rdev = NULL is set, the device information is not stored. nsub indicates the number of physical<br />

device subunits belonging to the device designated in devnm or dd.<br />

The device ID of the device designated in devnm is passed in the return code. E NOEXS The device<br />

designated in devnm does not exist.<br />

• INT tk_lst_dev( T_LDEV *ldev, INT start, INT ndev )<br />

ldev<br />

start<br />

ndev<br />

return code<br />

Location of registered device information (array)<br />

Starting number<br />

Number to acquire<br />

Remaining device registration count or error<br />

typedef struct t_ldev {<br />

ATR devatr; /* device attributes */<br />

INT blksz; /* device-specific data block size (-1: unknown) */<br />

INT nsub; /* subunits */<br />

UB devnm[L_DEVNM]; /* physical device name */<br />

/* Implementation-dependent information may be added beyond this point.*/<br />

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