3 * Purpose: Generic exception handling for ColdFire processors
\r
6 #include "exceptions.h"
\r
8 #include "support_common.h"
\r
9 #include <ansi_parms.h>
\r
11 #define REGISTER_ABI __REGABI__
\r
14 extern void vPIT0InterruptHandler( void );
\r
15 extern void vUART0InterruptHandler( void );
\r
16 extern void vPortYieldISR( void );
\r
17 extern void vFECISRHandler( void );
\r
19 /***********************************************************************/
\r
21 * Set NO_PRINTF to 0 in order the exceptions.c interrupt handler
\r
22 * to output messages to the standard io.
\r
28 #define VECTORDISPLAY(MESSAGE) asm { nop; };
\r
29 #define VECTORDISPLAY2(MESSAGE,MESSAGE2) asm { nop; };
\r
30 #define VECTORDISPLAY3(MESSAGE,MESSAGE2,MESSAGE3) asm { nop; };
\r
33 #define VECTORDISPLAY(MESSAGE1) printf(MESSAGE1);
\r
34 #define VECTORDISPLAY2(MESSAGE1,MESSAGE2) printf(MESSAGE1,MESSAGE2);
\r
35 #define VECTORDISPLAY3(MESSAGE1,MESSAGE2,MESSAGE3) printf(MESSAGE1,MESSAGE2,MESSAGE3);
\r
42 extern unsigned long far _SP_INIT[];
\r
44 /***********************************************************************/
\r
46 * Handling of the TRK ColdFire libs (printf support in Debugger Terminal)
\r
48 * To enable this support (setup by default in CONSOLE_RAM build target
\r
50 * - Set CONSOLE_IO_SUPPORT to 1 in this file; this will enable
\r
51 * TrapHandler_printf for the trap #14 exception.
\r
52 * (this is set by default to 1 in the ColdFire Pre-Processor panel for
\r
53 * the CONSOLE_RAM build target)
\r
55 * - Make sure the file:
\r
56 * {Compiler}ColdFire_Support\msl\MSL_C\MSL_ColdFire\Src\console_io_cf.c
\r
57 * is referenced from your project.
\r
59 * - Make sure that in the CF Exceptions panel the check box
\r
60 * "46 TRAP #14 for Console I/O", in the "User Application Exceptions"
\r
64 #ifndef CONSOLE_IO_SUPPORT
\r
65 #define CONSOLE_IO_SUPPORT 0
\r
68 #if CONSOLE_IO_SUPPORT
\r
69 asm void TrapHandler_printf(void) {
\r
75 /***********************************************************************/
\r
77 * This is the handler for all exceptions which are not common to all
\r
80 * Called by mcf_exception_handler
\r
83 void derivative_interrupt(unsigned long vector)
\r
85 if (vector < 64 || vector > 192) {
\r
86 VECTORDISPLAY2("User Defined Vector #%d\n",vector);
\r
90 /***********************************************************************
\r
92 * This is the exception handler for all exceptions common to all
\r
93 * chips ColdFire. Most exceptions do nothing, but some of the more
\r
94 * important ones are handled to some extent.
\r
96 * Called by asm_exception_handler
\r
98 * The ColdFire family of processors has a simplified exception stack
\r
99 * frame that looks like the following:
\r
101 * 3322222222221111 111111
\r
102 * 1098765432109876 5432109876543210
\r
103 * 8 +----------------+----------------+
\r
104 * | Program Counter |
\r
105 * 4 +----------------+----------------+
\r
106 * |FS/Fmt/Vector/FS| SR |
\r
107 * SP --> 0 +----------------+----------------+
\r
109 * The stack self-aligns to a 4-byte boundary at an exception, with
\r
110 * the FS/Fmt/Vector/FS field indicating the size of the adjustment
\r
111 * (SP += 0,1,2,3 bytes).
\r
112 * 31 28 27 26 25 18 17 16 15 0
\r
113 * 4 +---------------------------------------+------------------------------------+
\r
114 * | Format | FS[3..2] | Vector | FS[1..0] | SR |
\r
115 * SP --> 0 +---------------------------------------+------------------------------------+
\r
117 #define MCF5XXX_RD_SF_FORMAT(PTR) \
\r
118 ((*((unsigned short *)(PTR)) >> 12) & 0x00FF)
\r
120 #define MCF5XXX_RD_SF_VECTOR(PTR) \
\r
121 ((*((unsigned short *)(PTR)) >> 2) & 0x00FF)
\r
123 #define MCF5XXX_RD_SF_FS(PTR) \
\r
124 ( ((*((unsigned short *)(PTR)) & 0x0C00) >> 8) | (*((unsigned short *)(PTR)) & 0x0003) )
\r
126 #define MCF5XXX_SF_SR(PTR) *(((unsigned short *)(PTR))+1)
\r
128 #define MCF5XXX_SF_PC(PTR) *((unsigned long *)(PTR)+1)
\r
130 #define MCF5XXX_EXCEPTFMT "%s -- PC = %#08X\n"
\r
133 void mcf_exception_handler(void *framepointer)
\r
135 volatile unsigned long exceptionStackFrame = (*(unsigned long *)(framepointer));
\r
136 volatile unsigned short stackFrameSR = MCF5XXX_SF_SR(framepointer);
\r
137 volatile unsigned short stackFrameWord = (*(unsigned short *)(framepointer));
\r
138 volatile unsigned long stackFrameFormat = (unsigned long)MCF5XXX_RD_SF_FORMAT(&stackFrameWord);
\r
139 volatile unsigned long stackFrameFS = (unsigned long)MCF5XXX_RD_SF_FS(&stackFrameWord);
\r
140 volatile unsigned long stackFrameVector = (unsigned long)MCF5XXX_RD_SF_VECTOR(&stackFrameWord);
\r
141 volatile unsigned long stackFramePC = MCF5XXX_SF_PC(framepointer);
\r
143 switch (stackFrameFormat)
\r
151 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT,"Illegal stack type", stackFramePC);
\r
155 switch (stackFrameVector)
\r
158 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Access Error", stackFramePC);
\r
159 switch (stackFrameFS)
\r
162 VECTORDISPLAY("Error on instruction fetch\n");
\r
165 VECTORDISPLAY("Error on operand write\n");
\r
168 VECTORDISPLAY("Attempted write to write-protected space\n");
\r
171 VECTORDISPLAY("Error on operand read\n");
\r
174 VECTORDISPLAY("Reserved Fault Status Encoding\n");
\r
179 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Address Error", stackFramePC);
\r
180 switch (stackFrameFS)
\r
183 VECTORDISPLAY("Error on instruction fetch\n");
\r
186 VECTORDISPLAY("Error on operand write\n");
\r
189 VECTORDISPLAY("Attempted write to write-protected space\n");
\r
192 VECTORDISPLAY("Error on operand read\n");
\r
195 VECTORDISPLAY("Reserved Fault Status Encoding\n");
\r
200 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Illegal instruction", stackFramePC);
\r
203 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Privilege violation", stackFramePC);
\r
206 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Trace Exception", stackFramePC);
\r
209 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Unimplemented A-Line Instruction", stackFramePC);
\r
212 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Unimplemented F-Line Instruction", stackFramePC);
\r
215 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Debug Interrupt", stackFramePC);
\r
218 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Format Error", stackFramePC);
\r
221 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Unitialized Interrupt", stackFramePC);
\r
224 VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Spurious Interrupt", stackFramePC);
\r
233 VECTORDISPLAY2("Autovector interrupt level %d\n", stackFrameVector - 24);
\r
251 VECTORDISPLAY2("TRAP #%d\n", stackFrameVector - 32);
\r
281 VECTORDISPLAY2("Reserved: #%d\n", stackFrameVector);
\r
284 derivative_interrupt(stackFrameVector);
\r
290 asm void asm_exception_handler(void)
\r
294 movem.l d0-d2/a0-a1, (sp)
\r
295 lea 24(sp),a0 /* A0 point to exception stack frame on the stack */
\r
296 jsr mcf_exception_handler
\r
297 movem.l (sp), d0-d2/a0-a1
\r
303 asm void asm_exception_handler(void)
\r
307 movem.l d0-d2/a0-a1, (sp)
\r
308 pea 24(sp) /* push exception frame address */
\r
309 jsr mcf_exception_handler
\r
310 movem.l 4(sp), d0-d2/a0-a1
\r
317 typedef void (* vectorTableEntryType)(void);
\r
319 #pragma define_section vectortable ".vectortable" far_absolute R
\r
321 /* CF have 255 vector + SP_INIT in the vector table (256 entries)
\r
323 __declspec(vectortable) vectorTableEntryType _vect[256] = { /* Interrupt vector table */
\r
324 (vectorTableEntryType)__SP_AFTER_RESET, /* 0 (0x000) Initial supervisor SP */
\r
325 _startup, /* 1 (0x004) Initial PC */
\r
326 asm_exception_handler, /* 2 (0x008) Access Error */
\r
327 asm_exception_handler, /* 3 (0x00C) Address Error */
\r
328 asm_exception_handler, /* 4 (0x010) Illegal Instruction */
\r
329 asm_exception_handler, /* 5 (0x014) Reserved */
\r
330 asm_exception_handler, /* 6 (0x018) Reserved */
\r
331 asm_exception_handler, /* 7 (0x01C) Reserved */
\r
332 asm_exception_handler, /* 8 (0x020) Privilege Violation */
\r
333 asm_exception_handler, /* 9 (0x024) Trace */
\r
334 asm_exception_handler, /* 10 (0x028) Unimplemented A-Line */
\r
335 asm_exception_handler, /* 11 (0x02C) Unimplemented F-Line */
\r
336 asm_exception_handler, /* 12 (0x030) Debug Interrupt */
\r
337 asm_exception_handler, /* 13 (0x034) Reserved */
\r
338 asm_exception_handler, /* 14 (0x038) Format Error */
\r
339 asm_exception_handler, /* 15 (0x03C) Unitialized Int */
\r
340 asm_exception_handler, /* 16 (0x040) Reserved */
\r
341 asm_exception_handler, /* 17 (0x044) Reserved */
\r
342 asm_exception_handler, /* 18 (0x048) Reserved */
\r
343 asm_exception_handler, /* 19 (0x04C) Reserved */
\r
344 asm_exception_handler, /* 20 (0x050) Reserved */
\r
345 asm_exception_handler, /* 21 (0x054) Reserved */
\r
346 asm_exception_handler, /* 22 (0x058) Reserved */
\r
347 asm_exception_handler, /* 23 (0x05C) Reserved */
\r
348 asm_exception_handler, /* 24 (0x060) Spurious Interrupt */
\r
349 asm_exception_handler, /* 25 (0x064) Autovector Level 1 */
\r
350 asm_exception_handler, /* 26 (0x068) Autovector Level 2 */
\r
351 asm_exception_handler, /* 27 (0x06C) Autovector Level 3 */
\r
352 asm_exception_handler, /* 28 (0x070) Autovector Level 4 */
\r
353 asm_exception_handler, /* 29 (0x074) Autovector Level 5 */
\r
354 asm_exception_handler, /* 30 (0x078) Autovector Level 6 */
\r
355 asm_exception_handler, /* 31 (0x07C) Autovector Level 7 */
\r
356 asm_exception_handler, /* 32 (0x080) TRAP #0 */
\r
357 asm_exception_handler, /* 33 (0x084) TRAP #1 */
\r
358 asm_exception_handler, /* 34 (0x088) TRAP #2 */
\r
359 asm_exception_handler, /* 35 (0x08C) TRAP #3 */
\r
360 asm_exception_handler, /* 36 (0x090) TRAP #4 */
\r
361 asm_exception_handler, /* 37 (0x094) TRAP #5 */
\r
362 asm_exception_handler, /* 38 (0x098) TRAP #6 */
\r
363 asm_exception_handler, /* 39 (0x09C) TRAP #7 */
\r
364 asm_exception_handler, /* 40 (0x0A0) TRAP #8 */
\r
365 asm_exception_handler, /* 41 (0x0A4) TRAP #9 */
\r
366 asm_exception_handler, /* 42 (0x0A8) TRAP #10 */
\r
367 asm_exception_handler, /* 43 (0x0AC) TRAP #11 */
\r
368 asm_exception_handler, /* 44 (0x0B0) TRAP #12 */
\r
369 asm_exception_handler, /* 45 (0x0B4) TRAP #13 */
\r
370 #if CONSOLE_IO_SUPPORT
\r
371 TrapHandler_printf, /* 46 (0x0B8) TRAP #14 */
\r
373 asm_exception_handler, /* 46 (0x0B8) TRAP #14 */
\r
375 asm_exception_handler, /* 47 (0x0BC) TRAP #15 */
\r
376 asm_exception_handler, /* 48 (0x0C0) Reserved */
\r
377 asm_exception_handler, /* 49 (0x0C4) Reserved */
\r
378 asm_exception_handler, /* 50 (0x0C8) Reserved */
\r
379 asm_exception_handler, /* 51 (0x0CC) Reserved */
\r
380 asm_exception_handler, /* 52 (0x0D0) Reserved */
\r
381 asm_exception_handler, /* 53 (0x0D4) Reserved */
\r
382 asm_exception_handler, /* 54 (0x0D8) Reserved */
\r
383 asm_exception_handler, /* 55 (0x0DC) Reserved */
\r
384 asm_exception_handler, /* 56 (0x0E0) Reserved */
\r
385 asm_exception_handler, /* 57 (0x0E4) Reserved */
\r
386 asm_exception_handler, /* 58 (0x0E8) Reserved */
\r
387 asm_exception_handler, /* 59 (0x0EC) Reserved */
\r
388 asm_exception_handler, /* 60 (0x0F0) Reserved */
\r
389 asm_exception_handler, /* 61 (0x0F4) Reserved */
\r
390 asm_exception_handler, /* 62 (0x0F8) Reserved */
\r
391 asm_exception_handler, /* 63 (0x0FC) Reserved */
\r
392 asm_exception_handler, /* 64 (0x100) Device-specific interrupts */
\r
393 asm_exception_handler, /* 65 (0x104) Device-specific interrupts */
\r
394 asm_exception_handler, /* 66 (0x108) Device-specific interrupts */
\r
395 asm_exception_handler, /* 67 (0x10C) Device-specific interrupts */
\r
396 asm_exception_handler, /* 68 (0x110) Device-specific interrupts */
\r
397 asm_exception_handler, /* 69 (0x114) Device-specific interrupts */
\r
398 asm_exception_handler, /* 70 (0x118) Device-specific interrupts */
\r
399 asm_exception_handler, /* 71 (0x11C) Device-specific interrupts */
\r
400 asm_exception_handler, /* 72 (0x120) Device-specific interrupts */
\r
401 asm_exception_handler, /* 73 (0x124) Device-specific interrupts */
\r
402 asm_exception_handler, /* 74 (0x128) Device-specific interrupts */
\r
403 asm_exception_handler, /* 75 (0x12C) Device-specific interrupts */
\r
404 asm_exception_handler, /* 76 (0x130) Device-specific interrupts */
\r
405 vUART0InterruptHandler, /* 77 (0x134) Device-specific interrupts */
\r
406 asm_exception_handler, /* 78 (0x138) Device-specific interrupts */
\r
407 asm_exception_handler, /* 79 (0x13C) Device-specific interrupts */
\r
408 vPortYieldISR, /* 80 (0x140) Device-specific interrupts */
\r
409 asm_exception_handler, /* 81 (0x144) Device-specific interrupts */
\r
410 asm_exception_handler, /* 82 (0x148) Device-specific interrupts */
\r
411 asm_exception_handler, /* 83 (0x14C) Device-specific interrupts */
\r
412 asm_exception_handler, /* 84 (0x150) Device-specific interrupts */
\r
413 asm_exception_handler, /* 85 (0x154) Device-specific interrupts */
\r
414 asm_exception_handler, /* 86 (0x158) Device-specific interrupts */
\r
415 asm_exception_handler, /* 87 (0x15C) Device-specific interrupts */
\r
416 asm_exception_handler, /* 88 (0x160) Device-specific interrupts */
\r
417 asm_exception_handler, /* 89 (0x164) Device-specific interrupts */
\r
418 asm_exception_handler, /* 90 (0x168) Device-specific interrupts */
\r
419 asm_exception_handler, /* 91 (0x16C) Device-specific interrupts */
\r
420 asm_exception_handler, /* 92 (0x170) Device-specific interrupts */
\r
421 asm_exception_handler, /* 93 (0x174) Device-specific interrupts */
\r
422 asm_exception_handler, /* 94 (0x178) Device-specific interrupts */
\r
423 asm_exception_handler, /* 95 (0x17C) Device-specific interrupts */
\r
424 asm_exception_handler, /* 96 (0x180) Level 1 software interrupt */
\r
425 asm_exception_handler, /* 97 (0x184) Level 2 software interrupt */
\r
426 asm_exception_handler, /* 98 (0x188) Level 3 software interrupt */
\r
427 asm_exception_handler, /* 99 (0x18C) Level 4 software interrupt */
\r
428 asm_exception_handler, /* 100 (0x190) Level 5 software interrupt */
\r
429 asm_exception_handler, /* 101 (0x194) Level 6 software interrupt */
\r
430 asm_exception_handler, /* 102 (0x198) Level 7 software interrupt */
\r
431 asm_exception_handler, /* 103 (0x19C) Reserved */
\r
432 asm_exception_handler, /* 104 (0x1A0) Reserved */
\r
433 asm_exception_handler, /* 105 (0x1A4) Reserved */
\r
434 asm_exception_handler, /* 106 (0x1A8) Reserved */
\r
435 asm_exception_handler, /* 107 (0x___) Reserved */
\r
436 asm_exception_handler, /* 108 (0x___) Reserved */
\r
437 asm_exception_handler, /* 109 (0x___) Reserved */
\r
438 asm_exception_handler, /* 110 (0x___) Reserved */
\r
439 asm_exception_handler, /* 111 (0x___) Reserved */
\r
440 asm_exception_handler, /* 112 (0x___) Reserved */
\r
441 asm_exception_handler, /* 113 (0x___) Reserved */
\r
442 asm_exception_handler, /* 114 (0x___) Reserved */
\r
443 asm_exception_handler, /* 115 (0x___) Reserved */
\r
444 asm_exception_handler, /* 116 (0x___) Reserved */
\r
445 asm_exception_handler, /* 117 (0x___) Reserved */
\r
446 asm_exception_handler, /* 118 (0x___) Reserved */
\r
447 vPIT0InterruptHandler, /* 119 (0x___) Reserved */
\r
448 asm_exception_handler, /* 120 (0x___) Reserved */
\r
449 asm_exception_handler, /* 121 (0x___) Reserved */
\r
450 asm_exception_handler, /* 122 (0x___) Reserved */
\r
451 asm_exception_handler, /* 123 (0x___) Reserved */
\r
452 asm_exception_handler, /* 124 (0x___) Reserved */
\r
453 asm_exception_handler, /* 125 (0x___) Reserved */
\r
454 asm_exception_handler, /* 126 (0x___) Reserved */
\r
455 asm_exception_handler, /* 127 (0x___) Reserved */
\r
456 asm_exception_handler, /* 128 (0x___) Reserved */
\r
457 asm_exception_handler, /* 129 (0x___) Reserved */
\r
458 asm_exception_handler, /* 130 (0x___) Reserved */
\r
459 asm_exception_handler, /* 131 (0x___) Reserved */
\r
460 asm_exception_handler, /* 132 (0x___) Reserved */
\r
461 asm_exception_handler, /* 133 (0x___) Reserved */
\r
462 asm_exception_handler, /* 134 (0x___) Reserved */
\r
463 asm_exception_handler, /* 135 (0x___) Reserved */
\r
464 asm_exception_handler, /* 136 (0x___) Reserved */
\r
465 asm_exception_handler, /* 137 (0x___) Reserved */
\r
466 asm_exception_handler, /* 138 (0x___) Reserved */
\r
467 asm_exception_handler, /* 139 (0x___) Reserved */
\r
468 asm_exception_handler, /* 140 (0x___) Reserved */
\r
469 asm_exception_handler, /* 141 (0x___) Reserved */
\r
470 asm_exception_handler, /* 142 (0x___) Reserved */
\r
471 asm_exception_handler, /* 143 (0x___) Reserved */
\r
472 asm_exception_handler, /* 144 (0x___) Reserved */
\r
473 asm_exception_handler, /* 145 (0x___) Reserved */
\r
474 asm_exception_handler, /* 146 (0x___) Reserved */
\r
475 asm_exception_handler, /* 147 (0x___) Reserved */
\r
476 asm_exception_handler, /* 148 (0x___) Reserved */
\r
477 asm_exception_handler, /* 149 (0x___) Reserved */
\r
478 asm_exception_handler, /* 150 (0x___) Reserved */
\r
479 asm_exception_handler, /* 151 (0x___) Reserved */
\r
480 asm_exception_handler, /* 152 (0x___) Reserved */
\r
481 asm_exception_handler, /* 153 (0x___) Reserved */
\r
482 asm_exception_handler, /* 154 (0x___) Reserved */
\r
483 asm_exception_handler, /* 155 (0x___) Reserved */
\r
484 asm_exception_handler, /* 156 (0x___) Reserved */
\r
485 asm_exception_handler, /* 157 (0x___) Reserved */
\r
486 asm_exception_handler, /* 158 (0x___) Reserved */
\r
487 asm_exception_handler, /* 159 (0x___) Reserved */
\r
488 asm_exception_handler, /* 160 (0x___) Reserved */
\r
489 asm_exception_handler, /* 161 (0x___) Reserved */
\r
490 asm_exception_handler, /* 162 (0x___) Reserved */
\r
491 asm_exception_handler, /* 163 (0x___) Reserved */
\r
492 asm_exception_handler, /* 164 (0x___) Reserved */
\r
493 asm_exception_handler, /* 165 (0x___) Reserved */
\r
494 asm_exception_handler, /* 166 (0x___) Reserved */
\r
495 asm_exception_handler, /* 167 (0x___) Reserved */
\r
496 asm_exception_handler, /* 168 (0x___) Reserved */
\r
497 asm_exception_handler, /* 169 (0x___) Reserved */
\r
498 asm_exception_handler, /* 170 (0x___) Reserved */
\r
499 asm_exception_handler, /* 171 (0x___) Reserved */
\r
500 asm_exception_handler, /* 172 (0x___) Reserved */
\r
501 asm_exception_handler, /* 173 (0x___) Reserved */
\r
502 asm_exception_handler, /* 174 (0x___) Reserved */
\r
503 asm_exception_handler, /* 175 (0x___) Reserved */
\r
504 asm_exception_handler, /* 176 (0x___) Reserved */
\r
505 asm_exception_handler, /* 177 (0x___) Reserved */
\r
506 asm_exception_handler, /* 178 (0x___) Reserved */
\r
507 asm_exception_handler, /* 179 (0x___) Reserved */
\r
508 asm_exception_handler, /* 180 (0x___) Reserved */
\r
509 asm_exception_handler, /* 181 (0x___) Reserved */
\r
510 asm_exception_handler, /* 182 (0x___) Reserved */
\r
511 asm_exception_handler, /* 183 (0x___) Reserved */
\r
512 asm_exception_handler, /* 184 (0x___) Reserved */
\r
513 asm_exception_handler, /* 185 (0x___) Reserved */
\r
514 asm_exception_handler, /* 186 (0x___) Reserved */
\r
515 asm_exception_handler, /* 187 (0x___) Reserved */
\r
516 asm_exception_handler, /* 188 (0x___) Reserved */
\r
517 asm_exception_handler, /* 189 (0x___) Reserved */
\r
518 asm_exception_handler, /* 190 (0x___) Reserved */
\r
519 asm_exception_handler, /* 191 (0x___) Reserved */
\r
520 asm_exception_handler, /* 192 (0x___) Reserved */
\r
521 asm_exception_handler, /* 193 (0x___) Reserved */
\r
522 asm_exception_handler, /* 194 (0x___) Reserved */
\r
523 asm_exception_handler, /* 195 (0x___) Reserved */
\r
524 asm_exception_handler, /* 196 (0x___) Reserved */
\r
525 asm_exception_handler, /* 197 (0x___) Reserved */
\r
526 asm_exception_handler, /* 198 (0x___) Reserved */
\r
527 asm_exception_handler, /* 199 (0x___) Reserved */
\r
528 asm_exception_handler, /* 200 (0x___) Reserved */
\r
529 asm_exception_handler, /* 201 (0x___) Reserved */
\r
530 asm_exception_handler, /* 202 (0x___) Reserved */
\r
531 asm_exception_handler, /* 203 (0x___) Reserved */
\r
532 asm_exception_handler, /* 204 (0x___) Reserved */
\r
533 asm_exception_handler, /* 205 (0x___) Reserved */
\r
534 asm_exception_handler, /* 206 (0x___) Reserved */
\r
535 asm_exception_handler, /* 207 (0x___) Reserved */
\r
536 asm_exception_handler, /* 208 (0x___) Reserved */
\r
537 asm_exception_handler, /* 209 (0x___) Reserved */
\r
538 asm_exception_handler, /* 210 (0x___) Reserved */
\r
539 asm_exception_handler, /* 211 (0x___) Reserved */
\r
540 asm_exception_handler, /* 212 (0x___) Reserved */
\r
541 asm_exception_handler, /* 213 (0x___) Reserved */
\r
542 asm_exception_handler, /* 214 (0x___) Reserved */
\r
543 asm_exception_handler, /* 215 (0x___) Reserved */
\r
544 asm_exception_handler, /* 216 (0x___) Reserved */
\r
545 asm_exception_handler, /* 217 (0x___) Reserved */
\r
546 asm_exception_handler, /* 218 (0x___) Reserved */
\r
547 asm_exception_handler, /* 219 (0x___) Reserved */
\r
548 asm_exception_handler, /* 220 (0x___) Reserved */
\r
549 asm_exception_handler, /* 221 (0x___) Reserved */
\r
550 asm_exception_handler, /* 222 (0x___) Reserved */
\r
551 asm_exception_handler, /* 223 (0x___) Reserved */
\r
552 asm_exception_handler, /* 224 (0x___) Reserved */
\r
553 asm_exception_handler, /* 225 (0x___) Reserved */
\r
554 asm_exception_handler, /* 226 (0x___) Reserved */
\r
555 asm_exception_handler, /* 227 (0x___) Reserved */
\r
556 asm_exception_handler, /* 228 (0x___) Reserved */
\r
557 asm_exception_handler, /* 229 (0x___) Reserved */
\r
558 asm_exception_handler, /* 230 (0x___) Reserved */
\r
559 asm_exception_handler, /* 231 (0x___) Reserved */
\r
560 asm_exception_handler, /* 232 (0x___) Reserved */
\r
561 asm_exception_handler, /* 233 (0x___) Reserved */
\r
562 asm_exception_handler, /* 234 (0x___) Reserved */
\r
563 asm_exception_handler, /* 235 (0x___) Reserved */
\r
564 asm_exception_handler, /* 236 (0x___) Reserved */
\r
565 asm_exception_handler, /* 237 (0x___) Reserved */
\r
566 asm_exception_handler, /* 238 (0x___) Reserved */
\r
567 asm_exception_handler, /* 239 (0x___) Reserved */
\r
568 asm_exception_handler, /* 240 (0x___) Reserved */
\r
569 asm_exception_handler, /* 241 (0x___) Reserved */
\r
570 asm_exception_handler, /* 242 (0x___) Reserved */
\r
571 asm_exception_handler, /* 243 (0x___) Reserved */
\r
572 asm_exception_handler, /* 244 (0x___) Reserved */
\r
573 asm_exception_handler, /* 245 (0x___) Reserved */
\r
574 asm_exception_handler, /* 246 (0x___) Reserved */
\r
575 asm_exception_handler, /* 247 (0x___) Reserved */
\r
576 asm_exception_handler, /* 248 (0x___) Reserved */
\r
577 asm_exception_handler, /* 249 (0x___) Reserved */
\r
578 asm_exception_handler, /* 250 (0x___) Reserved */
\r
579 asm_exception_handler, /* 251 (0x___) Reserved */
\r
580 asm_exception_handler, /* 252 (0x___) Reserved */
\r
581 asm_exception_handler, /* 253 (0x___) Reserved */
\r
582 asm_exception_handler, /* 254 (0x___) Reserved */
\r
583 asm_exception_handler, /* 255 (0x___) Reserved */
\r
586 /********************************************************************
\r
587 * MCF5xxx ASM utility functions
\r
589 asm void mcf5xxx_wr_vbr(unsigned long) { /* Set VBR */
\r
596 /********************************************************************
\r
597 * MCF5xxx startup copy functions:
\r
599 * Set VBR and performs RAM vector table initializatiom.
\r
600 * The following symbol should be defined in the lcf:
\r
603 * _vect is the start of the exception table in the code
\r
604 * In case _vect address is different from __VECTOR_RAM,
\r
605 * the vector table is copied from _vect to __VECTOR_RAM.
\r
606 * In any case VBR is set to __VECTOR_RAM.
\r
608 void initialize_exceptions(void)
\r
612 * Memory map definitions from linker command files used by mcf5xxx_startup
\r
618 * Copy the vector table to RAM
\r
620 if (__VECTOR_RAM != (unsigned long*)_vect)
\r
622 for (n = 0; n < 256; n++)
\r
623 __VECTOR_RAM[n] = (unsigned long)_vect[n];
\r
625 mcf5xxx_wr_vbr((unsigned long)__VECTOR_RAM);
\r
628 mcf5xxx_wr_vbr((unsigned long)_vect);
\r