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 | rtems_isr bsp_spurious_handler( |
---|
32 | rtems_vector_number vector /*, |
---|
33 | CPU_Interrupt_frame *isf */ |
---|
34 | ) |
---|
35 | { |
---|
36 | char *s; |
---|
37 | |
---|
38 | printk( "Unexpected interrupt (0x%x)\n", vector ); |
---|
39 | /* |
---|
40 | printk( "It looks like we got the interrupt at 0x%x\n", isf->interrupted ); |
---|
41 | */ |
---|
42 | |
---|
43 | /* |
---|
44 | * Can we print a name? |
---|
45 | */ |
---|
46 | |
---|
47 | s = 0; |
---|
48 | #if 0 |
---|
49 | if ( vector <= 0x1f ) { |
---|
50 | switch ( vector ) { |
---|
51 | case 1: s = "INT0"; break; |
---|
52 | case 2: s = "INT1"; break; |
---|
53 | case 3: s = "INT2"; break; |
---|
54 | case 4: s = "INT3"; break; |
---|
55 | case 5: s = "XINT0"; break; |
---|
56 | case 6: s = "RINT0"; break; |
---|
57 | case 7: s = "XINT1"; break; |
---|
58 | case 8: s = "RINT1"; break; |
---|
59 | case 9: s = "TINT0"; break; |
---|
60 | case 0x0a: s = "TINT1"; break; |
---|
61 | case 0x0b: s = "DINT0"; break; |
---|
62 | case 0x0c: s = "DINT1"; break; |
---|
63 | default: s = "Reserved"; break; |
---|
64 | } |
---|
65 | printk( "Looks like it was an %s\n", s ); |
---|
66 | } else { |
---|
67 | printk( "Looks like it was a TRAP%d\n", vector - 0x20 ); |
---|
68 | } |
---|
69 | #endif |
---|
70 | |
---|
71 | /* |
---|
72 | * Now call the BSP specific routine |
---|
73 | */ |
---|
74 | |
---|
75 | bsp_spurious_handler_assistant( vector/* , 0 */ ); |
---|
76 | } |
---|