1/*
2 * arch/v850/kernel/intv.S -- Interrupt vectors
3 *
4 *  Copyright (C) 2001,02,03  NEC Electronics Corporation
5 *  Copyright (C) 2001,02,03  Miles Bader <miles@gnu.org>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License.  See the file COPYING in the main directory of this
9 * archive for more details.
10 *
11 * Written by Miles Bader <miles@gnu.org>
12 */
13
14#include <asm/clinkage.h>
15#include <asm/irq.h>
16#include <asm/machdep.h>
17#include <asm/entry.h>
18
19#ifdef CONFIG_V850E_HIGHRES_TIMER
20#include <asm/highres_timer.h>
21#endif
22
23/* Jump to an interrupt/trap handler.  These handlers (defined in entry.S)
24   expect the stack-pointer to be saved in ENTRY_SP, so we use sp to do an
25   indirect jump (which avoids problems when the handler is more than a signed
26   22-bit offset away).  */
27#define JUMP_TO_HANDLER(name, sp_save_loc)				      \
28	st.w	sp, sp_save_loc;					      \
29	mov	hilo(name), sp;						      \
30	jmp	[sp]
31
32
33	/* Reset vector.  */
34	.section	.intv.reset, "ax"
35	.org	0x0
36	mov	hilo(C_SYMBOL_NAME(start)), r1;
37	jmp	[r1]
38
39
40	/* Generic interrupt vectors.  */
41	.section	.intv.common, "ax"
42	.balign	0x10
43	JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP)	// 0x10 - NMI0
44	.balign	0x10
45	JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP)	// 0x20 - NMI1
46	.balign	0x10
47	JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP)	// 0x30 - NMI2
48
49	.balign	0x10
50	JUMP_TO_HANDLER (trap, ENTRY_SP)	// 0x40 - TRAP0n
51	.balign	0x10
52	JUMP_TO_HANDLER (trap, ENTRY_SP)	// 0x50 - TRAP1n
53
54	.balign	0x10
55	JUMP_TO_HANDLER (dbtrap, ENTRY_SP)	// 0x60 - Illegal op / DBTRAP insn
56
57
58	/* Hardware interrupt vectors.  */
59	.section	.intv.mach, "ax"
60	.org	0x0
61
62#if defined(CONFIG_V850E_HIGHRES_TIMER) && defined(IRQ_INTCMD)
63
64	/* Interrupts before the highres timer interrupt.  */
65	.rept	IRQ_INTCMD (HIGHRES_TIMER_TIMER_D_UNIT)
66	.balign	0x10
67	JUMP_TO_HANDLER (irq, ENTRY_SP)
68	.endr
69
70	/* The highres timer interrupt.  */
71	.balign	0x10
72	JUMP_TO_HANDLER (C_SYMBOL_NAME (highres_timer_slow_tick_irq), ENTRY_SP)
73
74	/* Interrupts after the highres timer interrupt.  */
75	.rept	NUM_CPU_IRQS - IRQ_INTCMD (HIGHRES_TIMER_TIMER_D_UNIT) - 1
76	.balign	0x10
77	JUMP_TO_HANDLER (irq, ENTRY_SP)
78	.endr
79
80#else /* No highres timer */
81
82	.rept	NUM_CPU_IRQS
83	.balign	0x10
84	JUMP_TO_HANDLER (irq, ENTRY_SP)
85	.endr
86
87#endif /* Highres timer */
88