Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:47

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*
0004  *  This routine installs spurious interrupt handlers for the mrm.
0005  */
0006 
0007 /*
0008  *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
0009  *  On-Line Applications Research Corporation (OAR).
0010  *
0011  * Redistribution and use in source and binary forms, with or without
0012  * modification, are permitted provided that the following conditions
0013  * are met:
0014  * 1. Redistributions of source code must retain the above copyright
0015  *    notice, this list of conditions and the following disclaimer.
0016  * 2. Redistributions in binary form must reproduce the above copyright
0017  *    notice, this list of conditions and the following disclaimer in the
0018  *    documentation and/or other materials provided with the distribution.
0019  *
0020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0022  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0023  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0024  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0025  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0026  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0029  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0030  * POSSIBILITY OF SUCH DAMAGE.
0031  */
0032 
0033 #include <bsp.h>
0034 #include <bsp/fatal.h>
0035 #include <stdio.h>
0036 
0037 const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
0038    "Illegal Instruction","Zero Division","CHK, CHK2 Instruction",
0039    "TRAPcc, TRAPV Instruction","Privilege Violation","Trace",
0040    "Line 1010 Emulation","Line 1111 Emulation","Hardware Breakpoint",
0041    "Coprocessor Protocal Violation",
0042    "Format Error ans Uninitialized Interrupt","Unassigned",
0043    "Spurious Interrupt","AVec1","AVec2","AVec3","AVec4","AVec5","AVec6",
0044    "AVec7","Trap Instruction","Debug","Reboot","Reserved Coprocessor",
0045    "Reserved Unassigned","User Defined"};
0046 
0047 static rtems_isr Spurious_Isr(
0048   rtems_vector_number vector
0049 )
0050 {
0051   /*int sp = 0; */
0052 #if 0
0053   const char * const VectDescrip[] = {
0054     _Spurious_Error_[0],   _Spurious_Error_[0],  _Spurious_Error_[1],
0055     _Spurious_Error_[2],   _Spurious_Error_[3],  _Spurious_Error_[4],
0056     _Spurious_Error_[5],   _Spurious_Error_[6],  _Spurious_Error_[7],
0057     _Spurious_Error_[8],   _Spurious_Error_[9], _Spurious_Error_[10],
0058     _Spurious_Error_[11], _Spurious_Error_[12], _Spurious_Error_[13],
0059     _Spurious_Error_[13], _Spurious_Error_[14], _Spurious_Error_[14],
0060     _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
0061     _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
0062     _Spurious_Error_[15], _Spurious_Error_[16], _Spurious_Error_[17],
0063     _Spurious_Error_[18], _Spurious_Error_[19], _Spurious_Error_[20],
0064     _Spurious_Error_[21], _Spurious_Error_[22], _Spurious_Error_[23],
0065     _Spurious_Error_[24], _Spurious_Error_[23], _Spurious_Error_[23],
0066     _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
0067     _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
0068     _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
0069     _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[25],
0070     _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
0071     _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
0072     _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
0073     _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[27],
0074     _Spurious_Error_[27], _Spurious_Error_[27], _Spurious_Error_[27],
0075     _Spurious_Error_[27], _Spurious_Error_[28]};
0076 #endif
0077 
0078   /*asm volatile ( "movea.l   %%sp,%0 " : "=a" (sp) : "0" (sp) ); */
0079 
0080   _CPU_ISR_Set_level( 7 );
0081   /*_UART_flush(); */
0082 #if 0
0083   RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
0084   RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
0085   RAW_PUTS("\n\rRTEMS:    Vector: ");
0086   RAW_PUTI(vector);
0087   RAW_PUTS(" sp: ");
0088   RAW_PUTI(sp);
0089   RAW_PUTS("\n\r");
0090 #endif
0091   bsp_fatal( MRM332_FATAL_SPURIOUS_INTERRUPT );
0092 }
0093 
0094 void Spurious_Initialize(void)
0095 {
0096   rtems_vector_number vector;
0097 
0098   for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
0099     {
0100       switch (vector)
0101     {
0102     case 4:
0103     case 9:
0104     case 31:
0105     case 47:
0106     case 66:
0107       /* These vectors used by CPU32bug - don't overwrite them. */
0108       break;
0109 
0110     default:
0111       (void) set_vector( Spurious_Isr, vector, 1 );
0112       break;
0113     }
0114     }
0115 }