delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/10/21/09:29:00

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 <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <cl87ec$ul$1@coranto.ucs.mun.ca> (message from Jason Mills on
Thu, 21 Oct 2004 09:14:12 -0230)
Subject: Re: Interrupt Handler Hanging?
References: <cl6r7q$smb$1 AT coranto DOT ucs DOT mun DOT ca> <200410210022 DOT i9L0M2nc030107 AT envy DOT delorie DOT com> <cl87ec$ul$1 AT coranto DOT ucs DOT mun DOT ca>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019