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

4.104.114.84.95
Last change on this file since 274fa77 was 274fa77, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 28, 2002 at 11:10:39 PM

2002-02-28 Mike Panetta <ahuitzot@…>

  • console/sci.c, console/sci.h, console/console.c: Added new SCI driver.
  • start/start.c: Removed file.
  • start/start.S: New file, the asm portion of the updated start code.
  • start/configure.am: Added start.S, removed start.c
  • startup/start_c.c: New file, the C portion of the updated start code. Contains most of the code that was in the old start.c.
  • startup/configure.am: Added start_c.c to C_FILES.
  • include/bsp.h: Added include <rtems/bspIo.h>
  • 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#if 0
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#endif
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.