1 |
30 |
unneback |
/* Spurious_driver
|
2 |
|
|
*
|
3 |
|
|
* This routine installs spurious interrupt handlers for the efi68k.
|
4 |
|
|
*
|
5 |
|
|
* Input parameters: NONE
|
6 |
|
|
*
|
7 |
|
|
* Output parameters: NONE
|
8 |
|
|
*
|
9 |
|
|
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
|
10 |
|
|
* On-Line Applications Research Corporation (OAR).
|
11 |
|
|
*
|
12 |
|
|
* The license and distribution terms for this file may be
|
13 |
|
|
* found in the file LICENSE in this distribution or at
|
14 |
|
|
* http://www.OARcorp.com/rtems/license.html.
|
15 |
|
|
*
|
16 |
|
|
* $Id: spinit.c,v 1.2 2001-09-27 12:00:03 chris Exp $
|
17 |
|
|
*/
|
18 |
|
|
|
19 |
|
|
#include <bsp.h>
|
20 |
|
|
#include <stdio.h>
|
21 |
|
|
|
22 |
|
|
const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
|
23 |
|
|
"Illegal Instruction","Zero Division","CHK, CHK2 Instruction",
|
24 |
|
|
"TRAPcc, TRAPV Instruction","Privilege Violation","Trace",
|
25 |
|
|
"Line 1010 Emulation","Line 1111 Emulation","Hardware Breakpoint",
|
26 |
|
|
"Coprocessor Protocal Violation",
|
27 |
|
|
"Format Error ans Uninitialized Interrupt","Unassigned",
|
28 |
|
|
"Spurious Interrupt","AVec1","AVec2","AVec3","AVec4","AVec5","AVec6",
|
29 |
|
|
"AVec7","Trap Instruction","Debug","Reboot","Reserved Coprocessor",
|
30 |
|
|
"Reserved Unassigned","User Defined"};
|
31 |
|
|
|
32 |
|
|
rtems_isr Spurious_Isr(
|
33 |
|
|
rtems_vector_number vector
|
34 |
|
|
)
|
35 |
|
|
{
|
36 |
|
|
int sp = 0;
|
37 |
|
|
const char * const VectDescrip[] = {
|
38 |
|
|
_Spurious_Error_[0], _Spurious_Error_[0], _Spurious_Error_[1],
|
39 |
|
|
_Spurious_Error_[2], _Spurious_Error_[3], _Spurious_Error_[4],
|
40 |
|
|
_Spurious_Error_[5], _Spurious_Error_[6], _Spurious_Error_[7],
|
41 |
|
|
_Spurious_Error_[8], _Spurious_Error_[9], _Spurious_Error_[10],
|
42 |
|
|
_Spurious_Error_[11], _Spurious_Error_[12], _Spurious_Error_[13],
|
43 |
|
|
_Spurious_Error_[13], _Spurious_Error_[14], _Spurious_Error_[14],
|
44 |
|
|
_Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
|
45 |
|
|
_Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
|
46 |
|
|
_Spurious_Error_[15], _Spurious_Error_[16], _Spurious_Error_[17],
|
47 |
|
|
_Spurious_Error_[18], _Spurious_Error_[19], _Spurious_Error_[20],
|
48 |
|
|
_Spurious_Error_[21], _Spurious_Error_[22], _Spurious_Error_[23],
|
49 |
|
|
_Spurious_Error_[24], _Spurious_Error_[23], _Spurious_Error_[23],
|
50 |
|
|
_Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
|
51 |
|
|
_Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
|
52 |
|
|
_Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
|
53 |
|
|
_Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[25],
|
54 |
|
|
_Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
|
55 |
|
|
_Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
|
56 |
|
|
_Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
|
57 |
|
|
_Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[27],
|
58 |
|
|
_Spurious_Error_[27], _Spurious_Error_[27], _Spurious_Error_[27],
|
59 |
|
|
_Spurious_Error_[27], _Spurious_Error_[28]};
|
60 |
|
|
|
61 |
|
|
asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
|
62 |
|
|
|
63 |
|
|
_CPU_ISR_Set_level( 7 );
|
64 |
|
|
_UART_flush();
|
65 |
|
|
|
66 |
|
|
RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
|
67 |
|
|
RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
|
68 |
|
|
RAW_PUTS("\n\rRTEMS: Vector: ");
|
69 |
|
|
RAW_PUTI(vector);
|
70 |
|
|
RAW_PUTS(" sp: ");
|
71 |
|
|
RAW_PUTI(sp);
|
72 |
|
|
RAW_PUTS("\n\r");
|
73 |
|
|
|
74 |
|
|
bsp_cleanup();
|
75 |
|
|
|
76 |
|
|
for(;;);
|
77 |
|
|
}
|
78 |
|
|
|
79 |
|
|
void Spurious_Initialize(void)
|
80 |
|
|
{
|
81 |
|
|
rtems_vector_number vector;
|
82 |
|
|
|
83 |
|
|
for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
|
84 |
|
|
(void) set_vector( Spurious_Isr, vector, 1 );
|
85 |
|
|
}
|