Update to new build system.
[clinton/Smoothieware.git] / mbed / src / vendor / NXP / cmsis / LPC2368 / ARM / vector_functions.s
CommitLineData
172d42d9
AG
1;/* mbed Microcontroller Library - InterruptIn
2; * Copyright (c) 2006-2009 ARM Limited. All rights reserved.
3; */
4
5#line 1 "vector_functions.s"
6;
7;
8;
9
10#line 1 "vector_defns.h"
11
12
13
14
15
16
17
18
19
20#line 21 "vector_defns.h"
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39#line 47 "vector_defns.h"
40
41
42#line 58 "vector_defns.h"
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61#line 6 "vector_functions.s"
62
63
64 AREA VECFUNCS, CODE, READONLY
65 ARM
66 PRESERVE8
67
68
69
70
71
72 EXPORT __mbed_fiq [WEAK]
73 EXPORT __mbed_undef [WEAK]
74 EXPORT __mbed_prefetch_abort [WEAK]
75 EXPORT __mbed_data_abort [WEAK]
76 EXPORT __mbed_irq [WEAK]
77 EXPORT __mbed_swi [WEAK]
78 EXPORT __mbed_dcc_irq [WEAK]
79 EXPORT __mbed_reset [WEAK]
80 IMPORT __mbed_init_realmonitor
81
82;
83;
84__mbed_fiq
85 B __mbed_fiq
86
87;
88;
89__mbed_undef
90 LDR PC, =0x7fffffa0
91
92;
93;
94__mbed_prefetch_abort
95 LDR PC, =0x7fffffb0
96
97;
98;
99__mbed_data_abort
100 LDR PC, =0x7fffffc0
101
102;
103;
104;
105;
106;
107;
108;
109;
110;
111__mbed_irq
112 ;
113 MSR CPSR_c, #0x1F:OR:0x80:OR:0x40
114
115 ;
116 STMDB sp!, {r0-r3,r12,lr}
117
118 ;
119 MOV r0, #0xFFFFFF00
120 LDR r0, [r0]
121
122 ;
123 MOV lr, pc
124 BX r0
125
126 ;
127 MOV r0, #0xFFFFFF00
128 STR r0, [r0] ;
129
130 ;
131 LDMFD sp!,{r0-r3,r12,lr}
132
133 ;
134 MSR CPSR_c, #0x12:OR:0x80:OR:0x40
135
136 ;
137 SUBS pc, lr, #4
138
139;
140;
141;
142;
143__mbed_swi
144 ;
145 ;
146 STMFD sp!, {a4, r4, ip, lr}
147
148 ;
149 LDR r4, =0x40000040
150
151 ;
152 ;
153 LDR a4, =0x00940000
154 LDR PC, =0x7ffff820
155
156;
157;
158;
159;
160__mbed_dcc_irq
161
162 ;
163
164 ;
165 LDMFD sp!,{r0-r3,r12,lr}
166
167 ;
168 MSR CPSR_c, #0x12:OR:0x80:OR:0x40
169
170 ;
171
172 ;
173 SUB lr, lr, #4 ;
174 STMFD sp!, {ip,lr} ;
175
176 ;
177 LDR LR, =0xfffff000
178 STR LR, [LR, #0xf00]
179
180 ;
181 ;
182 ;
183 ;
184 LDR PC, =0x7fffffe0
185
186;
187; __mbed_reset is called after reset
188; we setup the stacks and realmonitor, then call Reset_Handler like on M3
189
190; Reset Handler
191
192Reset_Handler PROC
193 EXPORT Reset_Handler [WEAK]
194 IMPORT SystemInit
195 IMPORT __main
196 LDR R0, =SystemInit
197 MOV LR, PC
198 BX R0
199 LDR R0, =__main
200 BX R0
201 ENDP
202
203__mbed_reset
204
205 ;
206
207 LDR R0, =(0x40000000 + 0x8000)
208
209 ;
210 MSR CPSR_c, #0x1B:OR:0x80:OR:0x40
211 MOV SP, R0
212 SUB R0, R0, #0x00000040
213
214 ;
215 MSR CPSR_c, #0x17:OR:0x80:OR:0x40
216 MOV SP, R0
217 SUB R0, R0, #0x00000040
218
219 ;
220 MSR CPSR_c, #0x11:OR:0x80:OR:0x40
221 MOV SP, R0
222 SUB R0, R0, #0x00000000
223
224 ;
225 MSR CPSR_c, #0x12:OR:0x80:OR:0x40
226 MOV SP, R0
227 SUB R0, R0, #0x00000040
228
229 ;
230 MSR CPSR_c, #0x13:OR:0x80:OR:0x40
231 MOV SP, R0
232 SUB R0, R0, #0x00000040
233
234 ;
235 MSR CPSR_c, #0x10
236 MOV SP, R0
237
238 ;
239 LDR R0, =__mbed_init_realmonitor
240 MOV LR, PC
241 BX R0
242
243 ;
244 LDR R0, =Reset_Handler
245 BX R0
246
247
248 END