chris@mimsy.UUCP (Chris Torek) (12/23/88)
In article <16971@onfcanim.UUCP> dave@onfcanim.UUCP (Dave Martindale) writes: >Thus, it is common to have a Unibus device driver just handle the information >passed back from the device by an interrupt without ever doing anything >to change the state of the device. The DONE or READY bit and IENABLE bits >remain set, and the software knows that the hardware will not request >another interrupt. Right---for some devices, the sequence for (e.g.) a UART DONE interrupt is: if (buf->count) { dev->xmit = *buf->ptr++; buf->count--; } else dev->ctl &= ~INTERRUPT_ENABLE; but for typical DEC hardware one can leave out the `else' step. It does not really save anything, as you then must keep track of busy/ not-busy yourself: /* start DEC-style UART */ if ((softstate & BUSY) == 0) { dev->xmit = *buf->ptr++; buf->count--; softstate |= BUSY; } /* else let interrupt handle it */ interrupt: if (buf->count) { dev->xmit = *buf->ptr++; buf->count--; /* BUSY still on */ } else softstate &= ~BUSY; The ugly case is where you need to turn off interrupt enable, but you cannot *read* interrupt enable, so that you need need the software state anyway. (Actually, since reading from a device often interferes with the operation of that device---now that everything is microprocessor driven---you may *still* want the software state.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris