2 * File: arch/blackfin/mach-common/interrupt.S
4 * Author: D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>
5 * Kenneth Albanowski <kjahds@kjahds.com>
8 * Description: Interrupt Entries
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <asm/blackfin.h>
33 #include <linux/linkage.h>
34 #include <asm/entry.h>
35 #include <asm/asm-offsets.h>
36 #include <asm/trace.h>
37 #include <asm/traps.h>
38 #include <asm/thread_info.h>
40 #include <asm/context.S>
42 .extern _ret_from_exception
44 #ifdef CONFIG_I_ENTRY_L1
50 .align 4 /* just in case */
52 /* Common interrupt entry code. First we do CLI, then push
53 * RETI, to keep interrupts disabled, but to allow this state to be changed
55 * R0 contains the interrupt number, while R1 may contain the value of IPEND,
56 * or garbage if IPEND won't be needed by the ISR. */
94 [--sp] = r0; /* Skip reserved */
102 [--sp] = r1; /* IPEND - R1 may or may not be set up before jumping here. */
104 /* Switch to other method of keeping interrupts disabled. */
105 #ifdef CONFIG_DEBUG_HWERR
111 [--sp] = RETI; /* orig_pc */
112 /* Clear all L registers. */
118 #ifdef CONFIG_FRAME_POINTER
122 #if ANOMALY_05000283 || ANOMALY_05000315
133 call ___ipipe_grab_irq
136 if cc jump .Lcommon_restore_context;
137 #else /* CONFIG_IPIPE */
140 #endif /* CONFIG_IPIPE */
141 call _return_from_int;
142 .Lcommon_restore_context:
146 /* interrupt routine for ivhw - 5 */
149 #ifdef CONFIG_FRAME_POINTER
153 #if ANOMALY_05000283 || ANOMALY_05000315
162 # We are going to dump something out, so make sure we print IPEND properly
166 [sp + PT_IPEND] = r0;
168 /* set the EXCAUSE to HWERR for trap_c */
169 r0 = [sp + PT_SEQSTAT];
170 R1.L = LO(VEC_HWERR);
171 R1.H = HI(VEC_HWERR);
173 [sp + PT_SEQSTAT] = R0;
175 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
181 /* make sure EBIU_ERRMST is clear */
182 p0.l = LO(EBIU_ERRMST);
183 p0.h = HI(EBIU_ERRMST);
184 r0.l = (CORE_ERROR | CORE_MERROR);
188 call _ret_from_exception;
190 .Lcommon_restore_all_sys:
195 /* Interrupt routine for evt2 (NMI).
196 * We don't actually use this, so just return.
197 * For inner circle type details, please see:
198 * http://docs.blackfin.uclinux.org/doku.php?id=linux:nmi
205 /* interrupt routine for core timer - 6 */
207 TIMER_INTERRUPT_ENTRY(EVT_IVTMR_P)
209 /* interrupt routine for evt7 - 7 */
211 INTERRUPT_ENTRY(EVT_IVG7_P)
213 INTERRUPT_ENTRY(EVT_IVG8_P)
215 INTERRUPT_ENTRY(EVT_IVG9_P)
217 INTERRUPT_ENTRY(EVT_IVG10_P)
219 INTERRUPT_ENTRY(EVT_IVG11_P)
221 INTERRUPT_ENTRY(EVT_IVG12_P)
223 INTERRUPT_ENTRY(EVT_IVG13_P)
226 /* interrupt routine for system_call - 15 */
227 ENTRY(_evt_system_call)
229 #ifdef CONFIG_FRAME_POINTER
233 jump .Lcommon_restore_context;
234 ENDPROC(_evt_system_call)
237 ENTRY(___ipipe_call_irqtail)
244 [--sp] = ( r7:4, p5:3 );
245 p0.l = ___ipipe_irq_tail_hook;
246 p0.h = ___ipipe_irq_tail_hook;
251 ( r7:4, p5:3 ) = [sp++];
255 reti = [sp++]; /* IRQs are off. */
265 [--sp] = reti; /* IRQs on. */
267 jump 2b; /* Likely paranoid. */
269 sp += 4; /* Discard saved RETI */
270 r0.h = _evt14_softirq;
271 r0.l = _evt14_softirq;
276 p0.l = _bfin_irq_flags;
277 p0.h = _bfin_irq_flags;
280 #if 0 /* FIXME: this actually raises scheduling latencies */
281 /* Reenable interrupts */
286 ENDPROC(___ipipe_call_irqtail)
287 #endif /* CONFIG_IPIPE */