summaryrefslogtreecommitdiff
path: root/arch/v850/kernel/intv.S
blob: 671e4c6150dd7f0393d39e176634a01272168f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 * arch/v850/kernel/intv.S -- Interrupt vectors
 *
 *  Copyright (C) 2001,02,03  NEC Electronics Corporation
 *  Copyright (C) 2001,02,03  Miles Bader <miles@gnu.org>
 *
 * This file is subject to the terms and conditions of the GNU General
 * Public License.  See the file COPYING in the main directory of this
 * archive for more details.
 *
 * Written by Miles Bader <miles@gnu.org>
 */

#include <asm/clinkage.h>
#include <asm/irq.h>
#include <asm/machdep.h>
#include <asm/entry.h>

#ifdef CONFIG_V850E_HIGHRES_TIMER
#include <asm/highres_timer.h>
#endif

/* Jump to an interrupt/trap handler.  These handlers (defined in entry.S)
   expect the stack-pointer to be saved in ENTRY_SP, so we use sp to do an
   indirect jump (which avoids problems when the handler is more than a signed
   22-bit offset away).  */
#define JUMP_TO_HANDLER(name, sp_save_loc)				      \
	st.w	sp, sp_save_loc;					      \
	mov	hilo(name), sp;						      \
	jmp	[sp]


	/* Reset vector.  */
	.section	.intv.reset, "ax"
	.org	0x0
	mov	hilo(C_SYMBOL_NAME(start)), r1;
	jmp	[r1]


	/* Generic interrupt vectors.  */
	.section	.intv.common, "ax"
	.balign	0x10
	JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP)	// 0x10 - NMI0
	.balign	0x10
	JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP)	// 0x20 - NMI1
	.balign	0x10
	JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP)	// 0x30 - NMI2
	
	.balign	0x10
	JUMP_TO_HANDLER (trap, ENTRY_SP)	// 0x40 - TRAP0n
	.balign	0x10
	JUMP_TO_HANDLER (trap, ENTRY_SP)	// 0x50 - TRAP1n

	.balign	0x10
	JUMP_TO_HANDLER (dbtrap, ENTRY_SP)	// 0x60 - Illegal op / DBTRAP insn


	/* Hardware interrupt vectors.  */
	.section	.intv.mach, "ax"
	.org	0x0

#if defined (CONFIG_V850E_HIGHRES_TIMER) && defined (IRQ_INTCMD)

	/* Interrupts before the highres timer interrupt.  */
	.rept	IRQ_INTCMD (HIGHRES_TIMER_TIMER_D_UNIT)
	.balign	0x10
	JUMP_TO_HANDLER (irq, ENTRY_SP)
	.endr

	/* The highres timer interrupt.  */
	.balign	0x10
	JUMP_TO_HANDLER (C_SYMBOL_NAME (highres_timer_slow_tick_irq), ENTRY_SP)

	/* Interrupts after the highres timer interrupt.  */
	.rept	NUM_CPU_IRQS - IRQ_INTCMD (HIGHRES_TIMER_TIMER_D_UNIT) - 1
	.balign	0x10
	JUMP_TO_HANDLER (irq, ENTRY_SP)
	.endr

#else /* No highres timer */

	.rept	NUM_CPU_IRQS
	.balign	0x10
	JUMP_TO_HANDLER (irq, ENTRY_SP)
	.endr

#endif /* Highres timer */