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.

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

Gets information about registered devices.<br />

Registered devices are managed per physical device. The registered device information is therefore<br />

also obtained per physical device.<br />

When the number of registered devices is N, number are assigned serially to devices from 0 to<br />

N − 1. Starting from the number designated in start in accord with this scheme, the number of<br />

registrations designated in ndev is acquired and put in ldev. The space designated in ldev must<br />

be large enough to hold ndev registration information. The number of remaining registrations after<br />

start ( N − start ) is passed in the return code. If the number of registrations from start is<br />

fewer than ndev, all remaining registrations are stored. A value passed in return code less than or<br />

equal to ndev means all remaining registrations were obtained. Note that this numbering changes<br />

as devices are registered and deleted. For this reason, accurate information may not always be<br />

obtained if the acquisition is carried out over multiple operations.<br />

E NOEXS<br />

start exceeds the number of registered devices<br />

• INT tk_evt_dev( ID devid, INT evttyp, VP evtinf )<br />

devid<br />

evttyp<br />

evtinf<br />

return code<br />

Event destination device ID<br />

Driver request event type<br />

Information for each event type<br />

Return code from device driver or error<br />

Sends a driver request event to the device (device driver) designated in devid.<br />

The following driver request events are defined.<br />

#define TDV_CARDEVT 1 /* PC Card event (see Card Manager) */<br />

#define TDV_USBEVT 2 /* USB event (see USB Manager) */<br />

The functioning of driver request events and the contents of evtinf are defined for each event<br />

type.<br />

E NOEXS<br />

E PAR<br />

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

Internal device manager events (evttyp < 0) cannot be designated<br />

5.3.3 Device Registration<br />

The following device registration information is defined in registering a device.<br />

Device registration is performed for each physical device.<br />

typedef struct t_ddev {<br />

VP exinf; /* extended information */<br />

ATR drvatr; /* driver attributes */<br />

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

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

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

FP openfn; /* open count */<br />

FP closefn; /* close count */<br />

FP execfn; /* processing start function */<br />

FP waitfn; /* completion wait function */<br />

FP abortfn; /* abort processing function */<br />

FP eventfn; /* event function */<br />

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

} T\_DDEV;<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!