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.

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

See the device driver specifications for event details.<br />

Measures must be taken so that if event notification cannot be sent because the message buffer is full,<br />

the lack of notification will not adversely affect operation on the receiving end. One option is to hold<br />

the notification until space becomes available in the message buffer, but in that case other device driver<br />

processing should not, as a rule, be allowed to fall behind as a result. Processing on the receiving end<br />

should be designed to the extent possible to avoid message buffer overflow.<br />

5.3.7 Device Suspend/Resume Processing<br />

Device drivers suspend and resume device operations in response to the issuing of suspend/resume<br />

(TDV SUSPEND/TDV RESUME) events to the event handling function (eventfn). Suspend and resume<br />

events are issued only to physical devices.<br />

TDV SUSPEND: Suspend Device<br />

evttyp = TDV SUSPEND<br />

evtinf = NULL (none)<br />

Suspension processing takes place in the following steps.<br />

(A) If there is a request being processed at the time, the device driver waits for it to complete,<br />

pauses it or aborts. Which of these options to take depends on the device driver implementation.<br />

Since the suspension must be effected as quickly as possible, however, pause or abort<br />

should be chosen if completion of the request will take time. Suspend events can be issued<br />

only for physical devices, but the same processing is applied to all logical devices included in<br />

the physical device.<br />

Pause: Processing is suspended, then continues after the device resumes operation.<br />

Abort: Processing is aborted just as when the abort function (abortfn) is executed, and is<br />

not continued after the device resumes operation.<br />

(B) New requests other than a resume event are not accepted.<br />

(C) The device power is cut and other suspension processing is performed.<br />

Abort should be avoided if at all possible because of its effects on applications. It should be used<br />

only in such cases as long input waits from a serial port, or when interruption would be difficult.<br />

Normally it is best to wait for completion of a request or, if possible, choose pause (suspension<br />

and resumption).<br />

Requests arriving at the device driver in suspend state are made to wait until operation resumes,<br />

after which acceptance processing is performed. If the request does not involve access to the<br />

device, however, or otherwise can be processed even during suspension, a request may be accepted<br />

without waiting for resumption.<br />

TDV RESUME: Resume Device<br />

evttyp = TDV RESUME<br />

evtinf = NULL (none)<br />

Resumption processing takes place as follows.<br />

(A) The device power is turned back on, the device states are restored and other device resumption<br />

processing is performed.<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!