1 | /* |
---|
2 | * C3X Spurious Trap Handler |
---|
3 | * |
---|
4 | * This is just enough of a trap handler to let us know what |
---|
5 | * the likely source of the trap was. |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989-1999. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #include <bsp.h> |
---|
18 | #include <bspIo.h> |
---|
19 | |
---|
20 | /* |
---|
21 | * bsp_spurious_handler |
---|
22 | * |
---|
23 | * Print a message on the debug console and then die |
---|
24 | */ |
---|
25 | |
---|
26 | void bsp_spurious_handler_assistant( |
---|
27 | rtems_vector_number, |
---|
28 | CPU_Interrupt_frame * |
---|
29 | ); |
---|
30 | |
---|
31 | #if defined(_C3x) |
---|
32 | rtems_isr bsp_spurious_handler( |
---|
33 | rtems_vector_number vector, |
---|
34 | CPU_Interrupt_frame *isf |
---|
35 | ) |
---|
36 | { |
---|
37 | char *s; |
---|
38 | |
---|
39 | printk( "Unexpected interrupt (0x%x)\n", vector ); |
---|
40 | printk( "It looks like we got the interrupt at 0x%x\n", isf->interrupted ); |
---|
41 | |
---|
42 | /* |
---|
43 | * Can we print a name? |
---|
44 | */ |
---|
45 | |
---|
46 | s = 0; |
---|
47 | if ( vector <= 0x1f ) { |
---|
48 | switch ( vector ) { |
---|
49 | #if defined(_C30) || defined(_C31) |
---|
50 | case 0: s = "RESET"; break; |
---|
51 | #endif |
---|
52 | case 1: s = "INT0"; break; |
---|
53 | case 2: s = "INT1"; break; |
---|
54 | case 3: s = "INT2"; break; |
---|
55 | case 4: s = "INT3"; break; |
---|
56 | case 5: s = "XINT0"; break; |
---|
57 | case 6: s = "RINT0"; break; |
---|
58 | #if defined(_C30) || defined(_C31) |
---|
59 | case 7: s = "XINT1"; break; |
---|
60 | case 8: s = "RINT1"; break; |
---|
61 | #endif |
---|
62 | case 9: s = "TINT0"; break; |
---|
63 | case 0x0a: s = "TINT1"; break; |
---|
64 | case 0x0b: s = "DINT0"; break; |
---|
65 | #if defined(_C32) |
---|
66 | case 0x0c: s = "DINT1"; break; |
---|
67 | #endif |
---|
68 | default: s = "Reserved"; break; |
---|
69 | } |
---|
70 | printk( "Looks like it was an %s\n", s ); |
---|
71 | } else { |
---|
72 | printk( "Looks like it was a TRAP%d\n", vector - 0x20 ); |
---|
73 | #if defined(_C30) || defined(_C31) |
---|
74 | if ( vector > 0x3B ) |
---|
75 | printk( "But TRAP27 - TRAP31 are reserved\n" ); |
---|
76 | #endif |
---|
77 | } |
---|
78 | |
---|
79 | /* |
---|
80 | * Now call the BSP specific routine |
---|
81 | */ |
---|
82 | |
---|
83 | bsp_spurious_handler_assistant( vector, isf ); |
---|
84 | } |
---|
85 | #endif |
---|