source: rtems/c/src/lib/libbsp/powerpc/ppcn_60x/startup/spurious.c @ 5f0a4c81

4.104.114.84.95
Last change on this file since 5f0a4c81 was 5f0a4c81, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/15/05 at 06:00:05

2005-02-14 Ralf Corsepius <ralf.corsepius@…>

  • startup/spurious.c: Merge ppc603 and ppc603e. Remove digits (Unused).
  • Property mode set to 100644
File size: 3.8 KB
Line 
1/*
2 *  PPCn_60x 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 *  Based upon the SPARC ERC32 version which was developed as
8 *  part of the port of RTEMS to the ERC32 implementation
9 *  of the SPARC by On-Line Applications Research Corporation (OAR)
10 *  under contract to the European Space Agency (ESA).
11 *
12 *  COPYRIGHT (c) 1995. European Space Agency.
13 *
14 *  This terms of the RTEMS license apply to this file.
15 *
16 *  $Id$
17 */
18
19#include <bsp.h>
20
21#include <string.h>
22
23rtems_isr bsp_stub_handler(
24   rtems_vector_number trap
25)
26{
27}
28
29/*
30 *  bsp_spurious_handler
31 *
32 *  Print a message on the debug console and then die
33 */
34rtems_isr bsp_spurious_handler(
35   rtems_vector_number trap
36)
37{
38
39  DEBUG_puts( "Spurious Trap" );
40
41  switch ( trap ) {
42    case PPC_IRQ_SYSTEM_RESET:
43      DEBUG_puts( "System reset" );
44      break;
45    case PPC_IRQ_MCHECK:
46      DEBUG_puts( "Machine check" );
47      break;
48    case PPC_IRQ_PROTECT:
49      DEBUG_puts( "DSI" );
50      break;
51    case PPC_IRQ_ISI:
52      DEBUG_puts( "ISI" );
53      break;
54    case PPC_IRQ_EXTERNAL:
55      DEBUG_puts( "External interupt" );
56      break;
57    case PPC_IRQ_ALIGNMENT:
58      DEBUG_puts( "Alignment Exception" );
59      break;
60    case PPC_IRQ_PROGRAM:
61      DEBUG_puts( "Program" );
62      break;
63    case PPC_IRQ_NOFP:
64      DEBUG_puts( "Floating point unavailable" );
65      break;
66    case PPC_IRQ_DECREMENTER:
67      DEBUG_puts( "Decrementer" );
68      break;
69    case PPC_IRQ_RESERVED_A:
70      DEBUG_puts( "Reserved 0x00a00" );
71      break;
72    case PPC_IRQ_RESERVED_B:
73      DEBUG_puts( "Reserved 0x00b00" );
74      break;
75    case PPC_IRQ_SCALL:
76      DEBUG_puts( "System call" );
77      break;
78    case PPC_IRQ_TRACE:
79      DEBUG_puts( "Trace" );
80      break;
81    case PPC_IRQ_FP_ASST:
82      DEBUG_puts( "Floating point Assist" );
83      break;
84
85#if defined(ppc403) || defined(ppc405)
86    case PPC_IRQ_CRIT :
87      DEBUG_puts( "Critical Error ");
88      break;
89    case PPC_IRQ_PIT:
90      DEBUG_puts( "Prog. Interval Timer " );
91      break;
92    case PPC_IRQ_FIT:
93      DEBUG_puts( "Fixed Interval Timer " );
94      break;
95    case PPC_IRQ_WATCHDOG :
96      DEBUG_puts( "Watchdog Timer " );
97      break;
98    case PPC_IRQ_DEBUG   :
99      DEBUG_puts( "Debug " );
100      break;
101
102#elif defined(ppc601)
103#error "Please fill in names. "
104    case PPC_IRQ_TRACE    :
105      DEBUG_puts( "0x02000" );
106      break;
107
108#elif defined(ppc603) || defined(ppc603e)
109    case PPC_IRQ_TRANS_MISS:
110      DEBUG_puts( "Instruction Translation Miss" );
111      break;
112    case PPC_IRQ_DATA_LOAD:
113      DEBUG_puts( "Data Load Translation Miss" );
114      break;
115    case PPC_IRQ_DATA_STORE:
116      DEBUG_puts( "Data store Translation Miss");
117      break;
118    case PPC_IRQ_ADDR_BRK:
119      DEBUG_puts( "Instruction address break point" );
120      break;
121    case PPC_IRQ_SYS_MGT:
122      DEBUG_puts( "System management interrupt" );
123      break;
124
125#elif defined(mpc604)
126#error "Please fill in names. "
127    case PPC_IRQ_ADDR_BRK:
128      DEBUG_puts( "0x1300" );
129      break;
130    case PPC_IRQ_SYS_MGT:
131      DEBUG_puts( "0x1400" );
132      break;
133#endif
134
135  default:
136     DEBUG_puts( "Undefined exception " );
137     break;
138  }
139
140  /*
141   *  What else can we do but stop ...
142   */
143  /*
144   asm volatile( "" );
145   */
146}
147
148/*
149 *  bsp_spurious_initialize
150 *
151 *  Install the spurious handler for most traps.
152 */
153
154void bsp_spurious_initialize()
155{
156  uint32_t         trap;
157
158  for ( trap=0 ; trap < PPC_IRQ_LAST ; trap++ ) {
159
160    /*
161     *  Skip window overflow, underflow, and flush as well as software
162     *  trap 0 which we will use as a shutdown.
163     */
164
165    set_vector( bsp_spurious_handler, trap,  1 );
166  }
167
168  set_vector( bsp_stub_handler, PPC_IRQ_DECREMENTER, 1 );
169  set_vector( bsp_stub_handler, PPC_IRQ_TRACE, 1 );
170  set_vector( bsp_stub_handler, PPC_IRQ_SYS_MGT, 1 );
171}
Note: See TracBrowser for help on using the repository browser.