|
Lines 217-226
Link Here
|
| 217 |
* I/O access to the controller/keyboard/mouse. The convention requires |
217 |
* I/O access to the controller/keyboard/mouse. The convention requires |
| 218 |
* close cooperation of the calling device driver. |
218 |
* close cooperation of the calling device driver. |
| 219 |
* |
219 |
* |
| 220 |
* The device driver which utilizes the `kbdio' module are assumed to |
220 |
* The device drivers which utilize the `kbdio' module are assumed to |
| 221 |
* have the following set of routines. |
221 |
* have the following set of routines. |
| 222 |
* a. An interrupt handler (the bottom half of the driver). |
222 |
* a. An interrupt handler (the bottom half of the driver). |
| 223 |
* b. Timeout routines which may briefly polls the keyboard controller. |
223 |
* b. Timeout routines which may briefly poll the keyboard controller. |
| 224 |
* c. Routines outside interrupt context (the top half of the driver). |
224 |
* c. Routines outside interrupt context (the top half of the driver). |
| 225 |
* They should follow the rules below: |
225 |
* They should follow the rules below: |
| 226 |
* 1. The interrupt handler may assume that it always has full access |
226 |
* 1. The interrupt handler may assume that it always has full access |
|
Lines 239-250
Link Here
|
| 239 |
* Therefore, `spltty()' must be strategically placed in the device |
239 |
* Therefore, `spltty()' must be strategically placed in the device |
| 240 |
* driver code. Also note that the timeout routine may interrupt |
240 |
* driver code. Also note that the timeout routine may interrupt |
| 241 |
* `kbdc_lock()' called by the top half of the driver, but this |
241 |
* `kbdc_lock()' called by the top half of the driver, but this |
| 242 |
* interruption is OK so long as the timeout routine observes the |
242 |
* interruption is OK so long as the timeout routine observes |
| 243 |
* the rule 4 below. |
243 |
* rule 4 below. |
| 244 |
* 4. The interrupt and timeout routines should not extend I/O operation |
244 |
* 4. The interrupt and timeout routines should not extend I/O operation |
| 245 |
* across more than one interrupt or timeout; they must complete |
245 |
* across more than one interrupt or timeout; they must complete any |
| 246 |
* necessary I/O operation within one invokation of the routine. |
246 |
* necessary I/O operation within one invocation of the routine. |
| 247 |
* This measns that if the timeout routine acquires the lock flag, |
247 |
* This means that if the timeout routine acquires the lock flag, |
| 248 |
* it must reset the flag to FALSE before it returns. |
248 |
* it must reset the flag to FALSE before it returns. |
| 249 |
*/ |
249 |
*/ |