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

Subversion Repositories openrisc_me

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

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

Line No. Rev Author Line
1 30 unneback
/*
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: spurious.c,v 1.2 2001-09-27 12:00:55 chris Exp $
17
 */
18
 
19
#include <bsp.h>
20
 
21
#include <string.h>
22
 
23
static const char digits[16] = "0123456789abcdef";
24
 
25
rtems_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
 */
36
rtems_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)
90
#error "Please fill in names. "                                  
91
    case PPC_IRQ_CRIT :
92
      DEBUG_puts( "Critical Error ");
93
      break;
94
    case PPC_IRQ_PIT:
95
      DEBUG_puts( "0x01000" );
96
      break;
97
    case PPC_IRQ_FIT:
98
      DEBUG_puts( "0x01010" );
99
      break;
100
    case PPC_IRQ_WATCHDOG :
101
      DEBUG_puts( "0x01020" );
102
      break;
103
    case PPC_IRQ_DEBUG   :
104
      DEBUG_puts( "0x02000" );
105
      break;
106
 
107
#elif defined(ppc601)
108
#error "Please fill in names. "                                  
109
    case PPC_IRQ_TRACE    :
110
      DEBUG_puts( "0x02000" );
111
      break;
112
 
113
#elif defined(ppc603)
114
#error "Please fill in names. "                                  
115
    case PPC_IRQ_TRANS_MISS :
116
      DEBUG_puts( "0x1000" );
117
      break;
118
    case PPC_IRQ_DATA_LOAD:
119
      DEBUG_puts( "0x1100" );
120
      break;
121
    case PPC_IRQ_DATA_STORE:
122
      DEBUG_puts( "0x1200" );
123
      break;
124
    case PPC_IRQ_ADDR_BRK:
125
      DEBUG_puts( "0x1300" );
126
      break;
127
    case PPC_IRQ_SYS_MGT:
128
      DEBUG_puts( "0x1400" );
129
      break;
130
 
131
#elif defined(ppc603e)
132
    case PPC_TLB_INST_MISS:
133
      DEBUG_puts( "Instruction Translation Miss" );
134
      break;
135
    case PPC_TLB_LOAD_MISS:
136
      DEBUG_puts( "Data Load Translation Miss" );
137
      break;
138
    case PPC_TLB_STORE_MISS :
139
      DEBUG_puts( "Data store Translation Miss");
140
      break;
141
    case PPC_IRQ_ADDRBRK:
142
      DEBUG_puts( "Instruction address break point" );
143
      break;
144
    case PPC_IRQ_SYS_MGT:
145
      DEBUG_puts( "System management interrupt" );
146
      break;
147
 
148
#elif defined(ppc604)
149
#error "Please fill in names. "                                  
150
    case PPC_IRQ_ADDR_BRK:
151
      DEBUG_puts( "0x1300" );
152
      break;
153
    case PPC_IRQ_SYS_MGT:
154
      DEBUG_puts( "0x1400" );
155
      break;
156
#endif
157
 
158
  default:
159
     DEBUG_puts( "Undefined exception " );
160
     break;
161
  }
162
 
163
  /*
164
   *  What else can we do but stop ...
165
   */
166
  /*
167
   asm volatile( "" );
168
   */
169
}
170
 
171
/*
172
 *  bsp_spurious_initialize
173
 *
174
 *  Install the spurious handler for most traps.
175
 */
176
 
177
void bsp_spurious_initialize()
178
{
179
  rtems_unsigned32 trap;
180
 
181
  for ( trap=0 ; trap < PPC_IRQ_LAST ; trap++ ) {
182
 
183
    /*
184
     *  Skip window overflow, underflow, and flush as well as software
185
     *  trap 0 which we will use as a shutdown.
186
     */
187
 
188
    set_vector( bsp_spurious_handler, trap,  1 );
189
  }
190
 
191
  set_vector( bsp_stub_handler, PPC_IRQ_DECREMENTER, 1 );
192
  set_vector( bsp_stub_handler, PPC_IRQ_TRACE, 1 );
193
  set_vector( bsp_stub_handler, PPC_IRQ_SYS_MGT, 1 );
194
}
195
 
196
 
197
 
198
 
199
 
200
 
201
 
202
 

powered by: WebSVN 2.1.0

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