OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [score603e/] [startup/] [spurious.c] - Blame information for rev 562

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  Score603e 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
 *  Developed as part of the port of RTEMS to the ERC32 implementation
8
 *  of the SPARC by On-Line Applications Research Corporation (OAR)
9
 *  under contract to the European Space Agency (ESA).
10
 *
11
 *  COPYRIGHT (c) 1995. European Space Agency.
12
 *
13
 *  This terms of the RTEMS license apply to this file.
14
 *
15
 *  $Id: spurious.c,v 1.2 2001-09-27 12:01:04 chris Exp $
16
 */
17
 
18
#include <bsp.h>
19
 
20
#include <string.h>
21
 
22
static const char digits[16] = "0123456789abcdef";
23
 
24
rtems_isr bsp_stub_handler(
25
   rtems_vector_number trap
26
)
27
{
28
}
29
 
30
/*
31
 *  bsp_spurious_handler
32
 *
33
 *  Print a message on the debug console and then die
34
 */
35
rtems_isr bsp_spurious_handler(
36
   rtems_vector_number trap
37
)
38
{
39
 
40
  switch ( trap ) {
41
    case PPC_IRQ_SYSTEM_RESET:
42
      DEBUG_puts( "\nTrap: System reset" );
43
      break;
44
    case PPC_IRQ_MCHECK:
45
      DEBUG_puts( "\nTrap: Machine check" );
46
      break;
47
    case PPC_IRQ_PROTECT:
48
      DEBUG_puts( "\nTrap: DSI" );
49
      break;
50
    case PPC_IRQ_ISI:
51
      DEBUG_puts( "ISI" );
52
      break;
53
    case PPC_IRQ_EXTERNAL:
54
      DEBUG_puts( "\nTrap: External interupt" );
55
      break;
56
    case PPC_IRQ_ALIGNMENT:
57
      DEBUG_puts( "\nTrap: Alignment Exception" );
58
      break;
59
    case PPC_IRQ_PROGRAM:
60
      DEBUG_puts( "\nTrap: Program" );
61
      break;
62
    case PPC_IRQ_NOFP:
63
      DEBUG_puts( "\nTrap: Floating point unavailable" );
64
      break;
65
    case PPC_IRQ_DECREMENTER:
66
      DEBUG_puts( "\nTrap: Decrementer" );
67
      break;
68
    case PPC_IRQ_RESERVED_A:
69
      DEBUG_puts( "\nTrap: Reserved 0x00a00" );
70
      break;
71
    case PPC_IRQ_RESERVED_B:
72
      DEBUG_puts( "\nTrap: Reserved 0x00b00" );
73
      break;
74
    case PPC_IRQ_SCALL:
75
      DEBUG_puts( "\nTrap: System call" );
76
      break;
77
    case PPC_IRQ_TRACE:
78
      DEBUG_puts( "\nTrap: Trace" );
79
      break;
80
    case PPC_IRQ_FP_ASST:
81
      DEBUG_puts( "\nTrap: Floating point Assist" );
82
      break;
83
 
84
#if defined(ppc403)
85
#error "Please fill in names. "                                  
86
    case PPC_IRQ_CRIT :
87
      DEBUG_puts( "\nTrap: Critical Error ");
88
      break;
89
    case PPC_IRQ_PIT:
90
      DEBUG_puts( "\nTrap: 0x01000" );
91
      break;
92
    case PPC_IRQ_FIT:
93
      DEBUG_puts( "\nTrap: 0x01010" );
94
      break;
95
    case PPC_IRQ_WATCHDOG :
96
      DEBUG_puts( "\nTrap: 0x01020" );
97
      break;
98
    case PPC_IRQ_DEBUG   :
99
      DEBUG_puts( "\nTrap: 0x02000" );
100
      break;
101
 
102
#elif defined(ppc601)
103
#error "Please fill in names. "                                  
104
    case PPC_IRQ_TRACE    :
105
      DEBUG_puts( "\nTrap: 0x02000" );
106
      break;
107
 
108
#elif defined(ppc603)
109
#error "Please fill in names. "                                  
110
    case PPC_IRQ_TRANS_MISS :
111
      DEBUG_puts( "\nTrap: 0x1000" );
112
      break;
113
    case PPC_IRQ_DATA_LOAD:
114
      DEBUG_puts( "\nTrap: 0x1100" );
115
      break;
116
    case PPC_IRQ_DATA_STORE:
117
      DEBUG_puts( "\nTrap: 0x1200" );
118
      break;
119
    case PPC_IRQ_ADDR_BRK:
120
      DEBUG_puts( "\nTrap: 0x1300" );
121
      break;
122
    case PPC_IRQ_SYS_MGT:
123
      DEBUG_puts( "\nTrap: 0x1400" );
124
      break;
125
 
126
#elif defined(ppc603e)
127
    case PPC_TLB_INST_MISS:
128
      DEBUG_puts( "\nTrap: Instruction Translation Miss" );
129
      break;
130
    case PPC_TLB_LOAD_MISS:
131
      DEBUG_puts( "\nTrap: Data Load Translation Miss" );
132
      break;
133
    case PPC_TLB_STORE_MISS :
134
      DEBUG_puts( "\nTrap: Data store Translation Miss");
135
      break;
136
    case PPC_IRQ_ADDRBRK:
137
      DEBUG_puts( "\nTrap: Instruction address break point" );
138
      break;
139
    case PPC_IRQ_SYS_MGT:
140
      DEBUG_puts( "\nTrap: System management interrupt" );
141
      break;
142
 
143
#elif defined(ppc604)
144
#error "Please fill in names. "                                  
145
    case PPC_IRQ_ADDR_BRK:
146
      DEBUG_puts( "0x1300" );
147
      break;
148
    case PPC_IRQ_SYS_MGT:
149
      DEBUG_puts( "0x1400" );
150
      break;
151
#endif
152
 
153
  default:
154
     DEBUG_puts( "\nTrap: Undefined exception " );
155
     break;
156
  }
157
 
158
  /*
159
   *  What else can we do but stop ...
160
   */
161
  /*
162
   asm volatile( "" );
163
   */
164
   while (1);
165
}
166
 
167
/*
168
 *  bsp_spurious_initialize
169
 *
170
 *  Install the spurious handler for most traps.
171
 */
172
 
173
void bsp_spurious_initialize()
174
{
175
  rtems_unsigned32 trap;
176
 
177
  for ( trap=0 ; trap < PPC_IRQ_LAST ; trap++ ) {
178
    if (trap == PPC_IRQ_DECREMENTER)
179
      ;
180
      /* set_vector( bsp_stub_handler, trap, 1 ); */
181
    else
182
      set_vector( bsp_spurious_handler, trap,  1 );
183
  }
184
}
185
 
186
void bsp_set_trap_vectors( void )
187
{
188
  volatile rtems_unsigned32 *ptr;
189
 
190
  /* reset_vector  */
191
  ptr = (rtems_unsigned32 *)0x00100  ;
192
  *ptr = 0x48000000;
193
 
194
  /* org    mach_vector  */
195
  ptr = (rtems_unsigned32 *)0x00200;
196
  *ptr = 0x48000000;
197
 
198
  /* org    prot_vector  */
199
  ptr = (rtems_unsigned32 *)0x00300;
200
  *ptr = 0x48000000;
201
 
202
  /* org    isi_vector  */
203
  ptr = (rtems_unsigned32 *)0x00400;
204
  *ptr = 0x48000000;
205
 
206
  /* org    ext_vector  */
207
  ptr = (rtems_unsigned32 *)0x0500  ;
208
  *ptr = 0x48000000;
209
 
210
  /* org    align_vector  */
211
  ptr = (rtems_unsigned32 *)0x00600  ;
212
  *ptr = 0x48000000;
213
 
214
  /* org    prog_vector  */
215
  ptr = (rtems_unsigned32 *)0x00700  ;
216
  *ptr = 0x48000000;
217
 
218
  /* org    float_vector  */
219
  ptr = (rtems_unsigned32 *)0x00800;
220
  *ptr = 0x48000000;
221
 
222
  /* org    dec_vector  - rfi */
223
  ptr = (rtems_unsigned32 *)0x900;
224
  *ptr = 0x4c000064;
225
 
226
  /* org    sys_vector  */
227
  ptr = (rtems_unsigned32 *)0x0c00  ;
228
  *ptr = 0x48000000;
229
 
230
  /* org    trace_vector  */
231
  ptr = (rtems_unsigned32 *)0x0d00  ;
232
  *ptr = 0x48000000;
233
 
234
  /* org    itm_vector  */
235
  ptr = (rtems_unsigned32 *)0x01000  ;
236
  *ptr = 0x48000000;
237
 
238
  /* org    dltm_vector  */
239
  ptr = (rtems_unsigned32 *)0x01100  ;
240
  *ptr = 0x48000000;
241
 
242
  /* org    dstm_vector  */
243
  ptr = (rtems_unsigned32 *)0x1200  ;
244
  *ptr = 0x48000000;
245
 
246
  /* org    addr_vector  */
247
  ptr = (rtems_unsigned32 *)0x1300  ;
248
  *ptr = 0x48000000;
249
 
250
  /* org    sysmgmt_vector  */
251
  ptr = (rtems_unsigned32 *)0x1400  ;
252
  *ptr = 0x48000000;
253
 
254
}
255
 
256
 
257
 
258
 
259
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.