1 /* $NetBSD: interrupts,v 1.1 2001/10/18 00:05:01 reinoud Exp $ */ 2 3 /* 4 * Copyright (c) 1996 Mark Brinicombe. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed by Mark Brinicombe. 18 * 4. The name of the company nor the name of the author may be used to 19 * endorse or promote products derived from this software without specific 20 * prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 */ 34 35 Notes on interrupts. 36 37 Ok since interrupts can be chained the return value from an interrupt 38 handler is important. 39 40 The following return values are defined : 41 42 -1 - interrupt may have been for us but not sure so pass it on 43 0 - interrupt no serviced (not ours) 44 interrupt serviced but pass on down the chain 45 1 - interrupt serviced do not pass on down the chain 46 47 The important bit is whether the interrupt should be passed on down 48 the chain of attached interrupt handlers. 49 50 For some interrupts and drivers where only a single device is 51 ever expected, the interrupt should be claimed if it has been serviced. 52 Passing it on down the chain may result in the stray interrupt handler 53 being called. 54 There are however some interrupt that should *always* be passed on down 55 the chain. These are interrupt which may commonly have multiple drivers 56 attached. 57 58 The following interrupts should always be passed on (return value of 0) 59 60 IRQ_TIMER0 61 IRQ_TIMER1 62 IRQ_VSYNC 63 IRQ_FLYBACK 64 IRQ_PODULE 65 66 IRQ_CLOCK (RC7500) 67 68 The following interrupts are recommended to be passed on 69 70 IRQ_DMACH0 71 IRQ_DMACH1 72 IRQ_DMACH2 73 IRQ_DMACH3 74 IRQ_DMASCH0 75 IRQ_DMASCH1 76 77 IRQ_SDMA (RC7500) 78 79 All other interrupts are not expected to be shared and may be claimed 80 when serviced. Stray IRQ handlers may or may not be attached to the end 81 of these irq chains. 82