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

4.104.114.84.95
Last change on this file since bad8092c was bad8092c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/31/04 at 03:49:17

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • clock/clock.c, console/config.c, console/console.c, console/debugio.c, console/i8042.c, console/ns16550cfg.c, console/ns16550cfg.h, console/vga.c, console/vga_p.h, console/z85c30cfg.c, console/z85c30cfg.h, include/bsp.h, include/nvram.h, include/pci.h, network/amd79c970.c, network/amd79c970.h, nvram/mk48t18.h, nvram/nvram.c, nvram/stk11c68.h, pci/pci.c, startup/bspstart.c, startup/genpvec.c, startup/spurious.c, startup/swap.c, timer/timer.c, tod/cmos.h, tod/tod.c, universe/universe.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 4.3 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
23static const char digits[16] = "0123456789abcdef";
24
25rtems_isr bsp_stub_handler(
26   rtems_vector_number trap
27)
28{
29}
30
31/*
32 *  bsp_spurious_handler
33 *
34 *  Print a message on the debug console and then die
35 */
36rtems_isr bsp_spurious_handler(
37   rtems_vector_number trap
38)
39{
40
41
42
43  DEBUG_puts( "Spurious Trap" );
44 
45  switch ( trap ) {
46    case PPC_IRQ_SYSTEM_RESET:
47      DEBUG_puts( "System reset" );
48      break;
49    case PPC_IRQ_MCHECK:
50      DEBUG_puts( "Machine check" );
51      break;
52    case PPC_IRQ_PROTECT:
53      DEBUG_puts( "DSI" );
54      break;
55    case PPC_IRQ_ISI:
56      DEBUG_puts( "ISI" );
57      break;
58    case PPC_IRQ_EXTERNAL:
59      DEBUG_puts( "External interupt" );
60      break;
61    case PPC_IRQ_ALIGNMENT:
62      DEBUG_puts( "Alignment Exception" );
63      break;
64    case PPC_IRQ_PROGRAM:
65      DEBUG_puts( "Program" );
66      break;
67    case PPC_IRQ_NOFP:
68      DEBUG_puts( "Floating point unavailable" );
69      break;
70    case PPC_IRQ_DECREMENTER:
71      DEBUG_puts( "Decrementer" );
72      break;
73    case PPC_IRQ_RESERVED_A:
74      DEBUG_puts( "Reserved 0x00a00" );
75      break;
76    case PPC_IRQ_RESERVED_B:
77      DEBUG_puts( "Reserved 0x00b00" );
78      break;
79    case PPC_IRQ_SCALL:
80      DEBUG_puts( "System call" );
81      break;
82    case PPC_IRQ_TRACE:
83      DEBUG_puts( "Trace" );
84      break;
85    case PPC_IRQ_FP_ASST:
86      DEBUG_puts( "Floating point Assist" );
87      break;
88
89#if defined(ppc403) || defined(ppc405)
90    case PPC_IRQ_CRIT :
91      DEBUG_puts( "Critical Error ");     
92      break;
93    case PPC_IRQ_PIT:
94      DEBUG_puts( "Prog. Interval Timer " );
95      break;
96    case PPC_IRQ_FIT:
97      DEBUG_puts( "Fixed Interval Timer " );
98      break;
99    case PPC_IRQ_WATCHDOG :
100      DEBUG_puts( "Watchdog Timer " );
101      break;
102    case PPC_IRQ_DEBUG   :
103      DEBUG_puts( "Debug " );
104      break;
105
106#elif defined(ppc601)
107#error "Please fill in names. "                                 
108    case PPC_IRQ_TRACE    :
109      DEBUG_puts( "0x02000" );
110      break;
111
112#elif defined(ppc603)
113#error "Please fill in names. "                                 
114    case PPC_IRQ_TRANS_MISS :
115      DEBUG_puts( "0x1000" );
116      break;
117    case PPC_IRQ_DATA_LOAD:
118      DEBUG_puts( "0x1100" );
119      break;
120    case PPC_IRQ_DATA_STORE:
121      DEBUG_puts( "0x1200" );
122      break;
123    case PPC_IRQ_ADDR_BRK:
124      DEBUG_puts( "0x1300" );
125      break;
126    case PPC_IRQ_SYS_MGT:
127      DEBUG_puts( "0x1400" );
128      break;
129
130#elif defined(ppc603e)
131    case PPC_TLB_INST_MISS:
132      DEBUG_puts( "Instruction Translation Miss" );
133      break;
134    case PPC_TLB_LOAD_MISS:
135      DEBUG_puts( "Data Load Translation Miss" );
136      break;
137    case PPC_TLB_STORE_MISS :
138      DEBUG_puts( "Data store Translation Miss");
139      break;
140    case PPC_IRQ_ADDRBRK:
141      DEBUG_puts( "Instruction address break point" );
142      break;
143    case PPC_IRQ_SYS_MGT:
144      DEBUG_puts( "System management interrupt" );
145      break;
146
147#elif defined(mpc604)
148#error "Please fill in names. "                                 
149    case PPC_IRQ_ADDR_BRK:
150      DEBUG_puts( "0x1300" );
151      break;
152    case PPC_IRQ_SYS_MGT:
153      DEBUG_puts( "0x1400" );
154      break;
155#endif
156
157  default:
158     DEBUG_puts( "Undefined exception " );
159     break;
160  }
161
162  /*
163   *  What else can we do but stop ...
164   */
165  /*
166   asm volatile( "" );
167   */
168}
169
170/*
171 *  bsp_spurious_initialize
172 *
173 *  Install the spurious handler for most traps.
174 */
175
176void bsp_spurious_initialize()
177{
178  uint32_t         trap;
179
180  for ( trap=0 ; trap < PPC_IRQ_LAST ; trap++ ) {
181
182    /*
183     *  Skip window overflow, underflow, and flush as well as software
184     *  trap 0 which we will use as a shutdown.
185     */
186
187    set_vector( bsp_spurious_handler, trap,  1 );
188  }
189
190  set_vector( bsp_stub_handler, PPC_IRQ_DECREMENTER, 1 );
191  set_vector( bsp_stub_handler, PPC_IRQ_TRACE, 1 );
192  set_vector( bsp_stub_handler, PPC_IRQ_SYS_MGT, 1 );
193}
194
195
196
197
198
199
200
201
Note: See TracBrowser for help on using the repository browser.