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

4.104.114.84.95
Last change on this file since 332484b5 was 332484b5, checked in by Joel Sherrill <joel.sherrill@…>, on May 25, 2001 at 4:28:46 PM

2000-05-25 Matt Cross <profesor@…>

  • New MRM332 BSP for the Mini RoboMind? board based on the 68332 microcontroller designed and build by Mark Castelluccio. For details on the MRM see http://www.robominds.com.
  • .cvsignore, ChangeLog? Makefile.am, README, bsp_specs, clock/.cvsignore, clock/Makefile.am, clock/ckinit.c, configure.in, console/.cvsignore, console/Makefile.am, console/console.c, include/.cvsignore, include/Makefile.am, include/bsp.h, include/mrm332.h, misc/dotests, misc/gdbinit68, misc/interr.c, spurious/.cvsignore, spurious/Makefile.am, spurious/spinit.c, start/.cvsignore, start/Makefile.am, start/start.c, startup/.cvsignore, startup/Makefile.am, startup/bspclean.c, startup/bspstart.c, startup/except_vect_332_ROM.S, startup/linkcmds, startup/linkcmds_ROM, timer/.cvsignore, timer/Makefile.am, timer/timer.c, times, wrapup/.cvsignore, wrapup/Makefile.am: Initial files.
  • 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.OARcorp.com/rtems/license.html.
15 *
16 *  $Id$
17 */
18
19#include <bsp.h>
20#include <stdio.h>
21
22const 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
32rtems_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  /* BDM SIGEMT */
77  asm("  .word  0x4afa");
78
79  for(;;);
80}
81
82void Spurious_Initialize(void)
83{
84  rtems_vector_number vector;
85
86  for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
87    {
88      switch (vector)
89        {
90        case 4:
91        case 9:
92        case 31:
93        case 47:
94        case 66:
95          /* These vectors used by CPU32bug - don't overwrite them. */
96          break;
97
98        default:
99          (void) set_vector( Spurious_Isr, vector, 1 );
100          break;
101        }
102    }
103}
Note: See TracBrowser for help on using the repository browser.