X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Thu, 21 Oct 2004 09:28:53 -0400 Message-Id: <200410211328.i9LDSr4v011196@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (message from Jason Mills on Thu, 21 Oct 2004 09:14:12 -0230) Subject: Re: Interrupt Handler Hanging? References: <200410210022 DOT i9L0M2nc030107 AT envy DOT delorie DOT com> Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Should I somehow (?) acknowledge when the interrupt handler is done?? I > notice some people return 0 at the end of the handler. > > Is there something special I should do if I replace the existing IRS > with my own? IIRC the checklist for interrupt handlers is: * clear the interrupt request in the hardware device. * ack the appropriate interrupt controller * ack the primary controller if the interrupt is serviced by the secondary one. * [do non-interruptible stuff here] - this includes servicing the hardware, so that it's allowed to trigger again. Note that this and the first step might be the same step; if so, do it before ack'ing the controllers. * STI to allow nested interrupts \ optional * [do interruptible stuff here] / steps * return from interrupt Note that for some devices, you have to LOOP the hardware service code, as they may have multiple requests for each interrupt, and you have to service them all to reset the device. It depends on the device; the serial port for example does this.