source: rtems/c/src/lib/libbsp/c4x/shared/c3xspurious.c @ 9daf475

Last change on this file since 9daf475 was 9daf475, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:43:55

2003-09-04 Joel Sherrill <joel@…>

  • bspspuriousinit.c, c3xspurious.c, c4xspurious.c: URL for license changed.
  • Property mode set to 100644
File size: 2.0 KB
Line 
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.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#include <bsp.h>
18#include <rtems/bspIo.h>
19
20/*
21 *  bsp_spurious_handler
22 *
23 *  Print a message on the debug console and then die
24 */
25
26void bsp_spurious_handler_assistant(
27  rtems_vector_number,
28  CPU_Interrupt_frame *
29);
30
31#if defined(_C3x)
32rtems_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
Note: See TracBrowser for help on using the repository browser.