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

4.115
Last change on this file since facf8362 was facf8362, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 6, 2012 at 4:42:41 PM

bsps: Add BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT

Use rtems_fatal() instead of bsp_cleanup().

  • 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/bootcard.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  rtems_fatal(
76    RTEMS_FATAL_SOURCE_BSP_GENERIC,
77    BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT
78  );
79}
80
81void Spurious_Initialize(void)
82{
83  rtems_vector_number vector;
84
85  for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
86    {
87      switch (vector)
88        {
89        case 4:
90        case 9:
91        case 31:
92        case 47:
93        case 66:
94          /* These vectors used by CPU32bug - don't overwrite them. */
95          break;
96
97        default:
98          (void) set_vector( Spurious_Isr, vector, 1 );
99          break;
100        }
101    }
102}
Note: See TracBrowser for help on using the repository browser.