2 * ip22-irq.S: Interrupt exception dispatch code for FullHouse and
5 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
9 #include <asm/mipsregs.h>
10 #include <asm/regdef.h>
11 #include <asm/stackframe.h>
13 /* A lot of complication here is taken away because:
15 * 1) We handle one interrupt and return, sitting in a loop and moving across
16 * all the pending IRQ bits in the cause register is _NOT_ the answer, the
17 * common case is one pending IRQ so optimize in that direction.
19 * 2) We need not check against bits in the status register IRQ mask, that
20 * would make this routine slow as hell.
22 * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
23 * between like BSD spl() brain-damage.
25 * Furthermore, the IRQs on the INDY look basically (barring software IRQs
26 * which we don't use at all) like:
30 * 0 Software (ignored)
31 * 1 Software (ignored)
32 * 2 Local IRQ level zero
33 * 3 Local IRQ level one
37 * 7 R4k timer (what we use)
39 * We handle the IRQ according to _our_ priority which is:
41 * Highest ---- R4k Timer
46 * Lowest ---- 8254 Timer one
48 * then we just return, if multiple IRQs are pending then we will just take
49 * another exception, big deal.
56 NESTED(indyIRQ, PT_SIZE, sp)
60 mfc0 s0, CP0_CAUSE # get irq mask
62 /* First we check for r4k counter/timer IRQ. */
63 andi a0, s0, CAUSEF_IP7
65 andi a0, s0, CAUSEF_IP2 # delay slot, check local level zero
67 /* Wheee, a timer interrupt. */
68 jal indy_r4k_timer_interrupt
69 move a0, sp # delay slot
75 andi a0, s0, CAUSEF_IP3 # delay slot, check local level one
77 /* Wheee, local level zero interrupt. */
78 jal indy_local0_irqdispatch
79 move a0, sp # delay slot
86 andi a0, s0, CAUSEF_IP6 # delay slot, check bus error
88 /* Wheee, local level one interrupt. */
89 jal indy_local1_irqdispatch
90 move a0, sp # delay slot
96 andi a0, s0, (CAUSEF_IP4 | CAUSEF_IP5) # delay slot
98 /* Wheee, an asynchronous bus error... */
100 move a0, sp # delay slot
105 /* Here by mistake? It is possible, that by the time we take
106 * the exception the IRQ pin goes low, so just leave if this
112 /* Must be one of the 8254 timers... */
113 jal indy_8254timer_irq
114 move a0, sp # delay slot