Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:01

0001 /*
0002  * This file contains the isp frames for the user interrupts.
0003  * From these procedures __ISR_Handler is called with the vector number
0004  * as argument.
0005  *
0006  * __ISR_Handler is kept in a separate file (cpu_asm.c), because a bug in
0007  * some releases of gcc doesn't properly handle #pragma interrupt, if a
0008  * file contains both isrs and normal functions.
0009  *
0010  *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
0011  *           Bernd Becker (becker@faw.uni-ulm.de)
0012  *
0013  *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
0014  *
0015  *  This program is distributed in the hope that it will be useful,
0016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
0018  *
0019  *
0020  *  COPYRIGHT (c) 1998.
0021  *  On-Line Applications Research Corporation (OAR).
0022  *
0023  *  The license and distribution terms for this file may be
0024  *  found in the file LICENSE in this distribution or at
0025  *  http://www.rtems.org/license/LICENSE.
0026  */
0027 
0028 #include <rtems/score/cpu.h>
0029 #include <rtems/score/ispsh7032.h>
0030 
0031 /*
0032  * This is an exception vector table
0033  *
0034  * It has the same structure like the actual vector table (vectab)
0035  */
0036 CPU_ISR_raw_handler _Hardware_isr_Table[256]={
0037 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0038 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0039 _dummy_isp, _dummy_isp, _dummy_isp,
0040 _nmi_isp, _usb_isp,
0041 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0042 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0043 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0044 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0045 _dummy_isp, _dummy_isp, _dummy_isp,
0046 /* trapa 0 -31 */
0047 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0048 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0049 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0050 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0051 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0052 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0053 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0054 _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
0055 /* irq 64 ... */
0056 _irq0_isp, _irq1_isp, _irq2_isp, _irq3_isp,
0057 _irq4_isp, _irq5_isp, _irq6_isp, _irq7_isp,
0058 _dma0_isp, _dummy_isp, _dma1_isp, _dummy_isp,
0059 _dma2_isp, _dummy_isp, _dma3_isp, _dummy_isp,
0060 _imia0_isp, _imib0_isp, _ovi0_isp, _dummy_isp,
0061 _imia1_isp, _imib1_isp, _ovi1_isp, _dummy_isp,
0062 _imia2_isp, _imib2_isp, _ovi2_isp, _dummy_isp,
0063 _imia3_isp, _imib3_isp, _ovi3_isp, _dummy_isp,
0064 _imia4_isp, _imib4_isp, _ovi4_isp, _dummy_isp,
0065 _eri0_isp, _rxi0_isp, _txi0_isp, _tei0_isp,
0066 _eri1_isp, _rxi1_isp, _txi1_isp, _tei1_isp,
0067 _prt_isp, _adu_isp, _dummy_isp, _dummy_isp,
0068 _wdt_isp,
0069 /* 113 */ _dref_isp
0070 };
0071 
0072 #define Str(a)#a
0073 
0074 /*
0075  * Some versions of gcc and all version of egcs at least until egcs-1.1b
0076  * are not able to handle #pragma interrupt correctly if more than 1 isr is
0077  * contained in a file and when optimizing.
0078  * We try to work around this problem by using the macro below.
0079  */
0080 #define isp( name, number, func)\
0081 __asm__ (".global _"Str(name)"\n\t" \
0082      "_"Str(name)":       \n\t" \
0083      "    mov.l r0,@-r15   \n\t" \
0084      "    mov.l r1,@-r15   \n\t" \
0085      "    mov.l r2,@-r15   \n\t" \
0086      "    mov.l r3,@-r15   \n\t" \
0087      "    mov.l r4,@-r15   \n\t" \
0088      "    mov.l r5,@-r15   \n\t" \
0089      "    mov.l r6,@-r15   \n\t" \
0090      "    mov.l r7,@-r15   \n\t" \
0091      "    mov.l r14,@-r15  \n\t" \
0092      "    sts.l pr,@-r15   \n\t" \
0093      "    sts.l mach,@-r15 \n\t" \
0094      "    sts.l macl,@-r15 \n\t" \
0095      "    mov r15,r14      \n\t" \
0096      "    mov.l "Str(name)"_k, r1\n\t" \
0097      "    jsr @r1           \n\t" \
0098      "    mov #"Str(number)", r4\n\t" \
0099      "    mov   r14,r15    \n\t" \
0100      "    lds.l @r15+,macl \n\t" \
0101      "    lds.l @r15+,mach \n\t" \
0102      "    lds.l @r15+,pr   \n\t" \
0103      "    mov.l @r15+,r14  \n\t" \
0104      "    mov.l @r15+,r7   \n\t" \
0105      "    mov.l @r15+,r6   \n\t" \
0106      "    mov.l @r15+,r5   \n\t" \
0107      "    mov.l @r15+,r4   \n\t" \
0108      "    mov.l @r15+,r3   \n\t" \
0109      "    mov.l @r15+,r2   \n\t" \
0110      "    mov.l @r15+,r1   \n\t" \
0111      "    mov.l @r15+,r0   \n\t" \
0112      "    rte              \n\t" \
0113      "    nop              \n\t" \
0114      "    .align 2         \n\t" \
0115      #name"_k: \n\t" \
0116      ".long "Str(func));
0117 
0118 /************************************************
0119  * Dummy interrupt service procedure for
0120  * interrupts being not allowed --> Trap 34
0121  ************************************************/
0122 __asm__ (" .section .text\n\
0123 .global __dummy_isp\n\
0124 __dummy_isp:\n\
0125       mov.l r14,@-r15\n\
0126       mov   r15, r14\n\
0127       trapa #34\n\
0128       mov.l @r15+,r14\n\
0129       rte\n\
0130       nop");
0131 
0132 /*****************************
0133  * Non maskable interrupt
0134  *****************************/
0135 isp( _nmi_isp, NMI_ISP_V, ___ISR_Handler);
0136 
0137 /*****************************
0138  * User break controller
0139  *****************************/
0140 isp( _usb_isp, USB_ISP_V, ___ISR_Handler);
0141 
0142 /*****************************
0143  *  External interrupts 0-7
0144  *****************************/
0145 isp( _irq0_isp, IRQ0_ISP_V, ___ISR_Handler);
0146 isp( _irq1_isp, IRQ1_ISP_V, ___ISR_Handler);
0147 isp( _irq2_isp, IRQ2_ISP_V, ___ISR_Handler);
0148 isp( _irq3_isp, IRQ3_ISP_V, ___ISR_Handler);
0149 isp( _irq4_isp, IRQ4_ISP_V, ___ISR_Handler);
0150 isp( _irq5_isp, IRQ5_ISP_V, ___ISR_Handler);
0151 isp( _irq6_isp, IRQ6_ISP_V, ___ISR_Handler);
0152 isp( _irq7_isp, IRQ7_ISP_V, ___ISR_Handler);
0153 
0154 /*****************************
0155  * DMA - controller
0156  *****************************/
0157 isp( _dma0_isp, DMA0_ISP_V, ___ISR_Handler);
0158 isp( _dma1_isp, DMA1_ISP_V, ___ISR_Handler);
0159 isp( _dma2_isp, DMA2_ISP_V, ___ISR_Handler);
0160 isp( _dma3_isp, DMA3_ISP_V, ___ISR_Handler);
0161 
0162 
0163 /*****************************
0164  * Interrupt timer unit
0165  *****************************/
0166 
0167 /*****************************
0168  * Timer 0
0169  *****************************/
0170 isp( _imia0_isp, IMIA0_ISP_V, ___ISR_Handler);
0171 isp( _imib0_isp, IMIB0_ISP_V, ___ISR_Handler);
0172 isp( _ovi0_isp,  OVI0_ISP_V, ___ISR_Handler);
0173 
0174 /*****************************
0175  * Timer 1
0176  *****************************/
0177 isp( _imia1_isp, IMIA1_ISP_V, ___ISR_Handler);
0178 isp( _imib1_isp, IMIB1_ISP_V, ___ISR_Handler);
0179 isp( _ovi1_isp,  OVI1_ISP_V, ___ISR_Handler);
0180 
0181 /*****************************
0182  * Timer 2
0183  *****************************/
0184 isp( _imia2_isp, IMIA2_ISP_V, ___ISR_Handler);
0185 isp( _imib2_isp, IMIB2_ISP_V, ___ISR_Handler);
0186 isp( _ovi2_isp,  OVI2_ISP_V, ___ISR_Handler);
0187 
0188 /*****************************
0189  * Timer 3
0190  *****************************/
0191 isp( _imia3_isp, IMIA3_ISP_V, ___ISR_Handler);
0192 isp( _imib3_isp, IMIB3_ISP_V, ___ISR_Handler);
0193 isp( _ovi3_isp,  OVI3_ISP_V, ___ISR_Handler);
0194 
0195 /*****************************
0196  * Timer 4
0197  *****************************/
0198 isp( _imia4_isp, IMIA4_ISP_V, ___ISR_Handler);
0199 isp( _imib4_isp, IMIB4_ISP_V, ___ISR_Handler);
0200 isp( _ovi4_isp,  OVI4_ISP_V, ___ISR_Handler);
0201 
0202 
0203 /*****************************
0204  * Serial interfaces
0205  *****************************/
0206 
0207 /*****************************
0208  * Serial interface 0
0209  *****************************/
0210 isp( _eri0_isp,  ERI0_ISP_V, ___ISR_Handler);
0211 isp( _rxi0_isp,  RXI0_ISP_V, ___ISR_Handler);
0212 isp( _txi0_isp,  TXI0_ISP_V, ___ISR_Handler);
0213 isp( _tei0_isp,  TEI0_ISP_V, ___ISR_Handler);
0214 
0215 /*****************************
0216  * Serial interface 1
0217  *****************************/
0218 isp( _eri1_isp,  ERI1_ISP_V, ___ISR_Handler);
0219 isp( _rxi1_isp,  RXI1_ISP_V, ___ISR_Handler);
0220 isp( _txi1_isp,  TXI1_ISP_V, ___ISR_Handler);
0221 isp( _tei1_isp,  TEI1_ISP_V, ___ISR_Handler);
0222 
0223 
0224 /*****************************
0225  * Parity control unit of
0226  * the bus state controller
0227  *****************************/
0228 isp( _prt_isp,  PRT_ISP_V, ___ISR_Handler);
0229 
0230 
0231 /******************************
0232  * Analog digital converter
0233  * ADC
0234  ******************************/
0235 isp( _adu_isp,  ADU_ISP_V, ___ISR_Handler);
0236 
0237 
0238 /******************************
0239  *  Watchdog timer
0240  ******************************/
0241 isp( _wdt_isp,  WDT_ISP_V, ___ISR_Handler);
0242 
0243 
0244 /******************************
0245  * DRAM refresh control unit
0246  * of bus state controller
0247  ******************************/
0248 isp( _dref_isp,  DREF_ISP_V, ___ISR_Handler);