source: rtems/c/src/lib/libbsp/m68k/mrm332/spurious/spinit.c @ ade27c6

4.115
Last change on this file since ade27c6 was ade27c6, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 20, 2013 at 9:44:04 AM

bsps: Move bsp_generic_fatal_code to new file

Add bsp_generic_fatal().

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*  Spurious_driver
2 *
3 *  This routine installs spurious interrupt handlers for the mrm.
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.rtems.com/license/LICENSE.
15 */
16
17#include <bsp.h>
18#include <bsp/generic-fatal.h>
19#include <stdio.h>
20
21const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
22   "Illegal Instruction","Zero Division","CHK, CHK2 Instruction",
23   "TRAPcc, TRAPV Instruction","Privilege Violation","Trace",
24   "Line 1010 Emulation","Line 1111 Emulation","Hardware Breakpoint",
25   "Coprocessor Protocal Violation",
26   "Format Error ans Uninitialized Interrupt","Unassigned",
27   "Spurious Interrupt","AVec1","AVec2","AVec3","AVec4","AVec5","AVec6",
28   "AVec7","Trap Instruction","Debug","Reboot","Reserved Coprocessor",
29   "Reserved Unassigned","User Defined"};
30
31rtems_isr Spurious_Isr(
32  rtems_vector_number vector
33)
34{
35  /*int sp = 0; */
36#if 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#endif
61
62  /*asm volatile ( "movea.l   %%sp,%0 " : "=a" (sp) : "0" (sp) ); */
63
64  _CPU_ISR_Set_level( 7 );
65  /*_UART_flush(); */
66#if 0
67  RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
68  RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
69  RAW_PUTS("\n\rRTEMS:    Vector: ");
70  RAW_PUTI(vector);
71  RAW_PUTS(" sp: ");
72  RAW_PUTI(sp);
73  RAW_PUTS("\n\r");
74#endif
75  bsp_generic_fatal( BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT );
76}
77
78void Spurious_Initialize(void)
79{
80  rtems_vector_number vector;
81
82  for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
83    {
84      switch (vector)
85        {
86        case 4:
87        case 9:
88        case 31:
89        case 47:
90        case 66:
91          /* These vectors used by CPU32bug - don't overwrite them. */
92          break;
93
94        default:
95          (void) set_vector( Spurious_Isr, vector, 1 );
96          break;
97        }
98    }
99}
Note: See TracBrowser for help on using the repository browser.