lm3s1968: make __delay() naked and usable outside the clock module.
[bertos.git] / bertos / cpu / cortex-m3 / hw / vectors_lm3s.c
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \brief LM3S1968 startup interrupt vector table
34  *
35  * \author Andrea Righi <arighi@develer.com>
36  */
37
38 #include <cfg/compiler.h>
39 #include <cpu/attr.h> /* PAUSE, UNREACHABLE */
40
41 extern size_t __stack_end;
42 extern void __init(void);
43
44 static void NORETURN NAKED default_isr(void)
45 {
46         PAUSE;
47         UNREACHABLE();
48 }
49
50 static void (* const irq_vectors[])(void) __attribute__ ((section(".vectors"))) =
51 {
52         (void (*)(void))&__stack_end,   /* Initial stack pointer */
53         __init,         /* The reset handler */
54         default_isr,    /* The NMI handler */
55         default_isr,    /* The hard fault handler */
56         default_isr,    /* The MPU fault handler */
57         default_isr,    /* The bus fault handler */
58         default_isr,    /* The usage fault handler */
59         0,              /* Reserved */
60         0,              /* Reserved */
61         0,              /* Reserved */
62         0,              /* Reserved */
63         default_isr,    /* SVCall handler */
64         default_isr,    /* Debug monitor handler */
65         0,              /* Reserved */
66         default_isr,    /* The PendSV handler */
67         default_isr,    /* The SysTick handler */
68         default_isr,    /* GPIO Port A */
69         default_isr,    /* GPIO Port B */
70         default_isr,    /* GPIO Port C */
71         default_isr,    /* GPIO Port D */
72         default_isr,    /* GPIO Port E */
73         default_isr,    /* UART0 Rx and Tx */
74         default_isr,    /* UART1 Rx and Tx */
75         default_isr,    /* SSI0 Rx and Tx */
76         default_isr,    /* I2C0 Master and Slave */
77         default_isr,    /* PWM Fault */
78         default_isr,    /* PWM Generator 0 */
79         default_isr,    /* PWM Generator 1 */
80         default_isr,    /* PWM Generator 2 */
81         default_isr,    /* Quadrature Encoder 0 */
82         default_isr,    /* ADC Sequence 0 */
83         default_isr,    /* ADC Sequence 1 */
84         default_isr,    /* ADC Sequence 2 */
85         default_isr,    /* ADC Sequence 3 */
86         default_isr,    /* Watchdog timer */
87         default_isr,    /* Timer 0 subtimer A */
88         default_isr,    /* Timer 0 subtimer B */
89         default_isr,    /* Timer 1 subtimer A */
90         default_isr,    /* Timer 1 subtimer B */
91         default_isr,    /* Timer 2 subtimer A */
92         default_isr,    /* Timer 2 subtimer B */
93         default_isr,    /* Analog Comparator 0 */
94         default_isr,    /* Analog Comparator 1 */
95         default_isr,    /* Analog Comparator 2 */
96         default_isr,    /* System Control (PLL, OSC, BO) */
97         default_isr,    /* FLASH Control */
98         default_isr,    /* GPIO Port F */
99         default_isr,    /* GPIO Port G */
100         default_isr,    /* GPIO Port H */
101         default_isr,    /* UART2 Rx and Tx */
102         default_isr,    /* SSI1 Rx and Tx */
103         default_isr,    /* Timer 3 subtimer A */
104         default_isr,    /* Timer 3 subtimer B */
105         default_isr,    /* I2C1 Master and Slave */
106         default_isr,    /* Quadrature Encoder 1 */
107         default_isr,    /* CAN0 */
108         default_isr,    /* CAN1 */
109         default_isr,    /* CAN2 */
110         default_isr,    /* Ethernet */
111         default_isr     /* Hibernate */
112 };