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

Last change on this file since 9daf475 was 9daf475, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:43:55 PM

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

  • bspspuriousinit.c, c3xspurious.c, c4xspurious.c: URL for license changed.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  C4X 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(_C4x)
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  printk( "Looks like it was a " );
47  if ( vector >= 0x0d && vector <= 0x24 ) {
48    switch ( vector & 0x3 ) {
49      case 1: s = "ICFULL"; break;
50      case 2: s = "ICRDY"; break;
51      case 3: s = "OCRDY"; break;
52      case 0: s = "OCEMPTY"; break;
53    }
54    printk( "%s%d\n", s, (vector - 0x0d) / 4 );
55  } else if ( vector >= 0x25 && vector <= 0x2a ) {
56    printk( "DMA INT%d\n", (vector - 0x25) );
57  } else /* if ( vector <= 0x0c || vector >= 0x2b ) */ {
58    switch ( vector ) {
59      case 0:     s = "RESET";     break;
60      case 1:     s = "NMI";       break;
61      case 2:     s = "TINT0";     break;
62      case 3:     s = "IIOF0";     break;
63      case 4:     s = "IIOF1";     break;
64      case 5:     s = "IIOF2";     break;
65      case 6:     s = "IIOF3";     break;
66      case 0x2b:  s = "TINT1";     break;
67      case 0x3f:  s = "Reserved";  break;
68      default:    s = "Unused";    break;
69    }
70    printk( "%s\n", s );
71  }
72
73  /*
74   *  Now call the BSP specific routine
75   */
76
77  bsp_spurious_handler_assistant( vector, isf );
78}
79#endif
Note: See TracBrowser for help on using the repository browser.