[50cf94da] | 1 | /* |
---|
| 2 | * This file contains the isp frames for the user interrupts. |
---|
| 3 | * From these procedures __ISR_Handler is called with the vector number |
---|
| 4 | * as argument. |
---|
| 5 | * |
---|
| 6 | * __ISR_Handler is kept in a separate file (cpu_asm.c), because a bug in |
---|
| 7 | * some releases of gcc doesn't properly handle #pragma interrupt, if a |
---|
| 8 | * file contains both isrs and normal functions. |
---|
| 9 | * |
---|
| 10 | * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and |
---|
| 11 | * Bernd Becker (becker@faw.uni-ulm.de) |
---|
| 12 | * |
---|
| 13 | * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany |
---|
| 14 | * |
---|
| 15 | * This program is distributed in the hope that it will be useful, |
---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE |
---|
| 18 | * |
---|
| 19 | * |
---|
| 20 | * COPYRIGHT (c) 1998. |
---|
| 21 | * On-Line Applications Research Corporation (OAR). |
---|
| 22 | * |
---|
| 23 | * The license and distribution terms for this file may be |
---|
| 24 | * found in the file LICENSE in this distribution or at |
---|
| 25 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 26 | * |
---|
| 27 | * $Id$ |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | #include <rtems/system.h> |
---|
[49d52e0] | 31 | #include <rtems/score/types.h> |
---|
[4a238002] | 32 | #include <rtems/score/ispsh7032.h> |
---|
| 33 | |
---|
[50cf94da] | 34 | /* |
---|
[4a238002] | 35 | * This is an exception vector table |
---|
[50cf94da] | 36 | * |
---|
| 37 | * It has the same structure like the actual vector table (vectab) |
---|
| 38 | */ |
---|
| 39 | proc_ptr _Hardware_isr_Table[256]={ |
---|
| 40 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 41 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 42 | _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 43 | _nmi_isp, _usb_isp, |
---|
| 44 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 45 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 46 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 47 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 48 | _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 49 | /* trapa 0 -31 */ |
---|
| 50 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 51 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 52 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 53 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 54 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 55 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 56 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 57 | _dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, |
---|
| 58 | /* irq 64 ... */ |
---|
| 59 | _irq0_isp, _irq1_isp, _irq2_isp, _irq3_isp, |
---|
| 60 | _irq4_isp, _irq5_isp, _irq6_isp, _irq7_isp, |
---|
| 61 | _dma0_isp, _dummy_isp, _dma1_isp, _dummy_isp, |
---|
| 62 | _dma2_isp, _dummy_isp, _dma3_isp, _dummy_isp, |
---|
| 63 | _imia0_isp, _imib0_isp, _ovi0_isp, _dummy_isp, |
---|
| 64 | _imia1_isp, _imib1_isp, _ovi1_isp, _dummy_isp, |
---|
| 65 | _imia2_isp, _imib2_isp, _ovi2_isp, _dummy_isp, |
---|
| 66 | _imia3_isp, _imib3_isp, _ovi3_isp, _dummy_isp, |
---|
| 67 | _imia4_isp, _imib4_isp, _ovi4_isp, _dummy_isp, |
---|
| 68 | _eri0_isp, _rxi0_isp, _txi0_isp, _tei0_isp, |
---|
| 69 | _eri1_isp, _rxi1_isp, _txi1_isp, _tei1_isp, |
---|
| 70 | _prt_isp, _adu_isp, _dummy_isp, _dummy_isp, |
---|
| 71 | _wdt_isp, |
---|
| 72 | /* 113 */ _dref_isp |
---|
| 73 | }; |
---|
| 74 | |
---|
| 75 | #define Str(a)#a |
---|
| 76 | |
---|
| 77 | /* |
---|
[714137ef] | 78 | * Some versions of gcc and all version of egcs at least until egcs-1.1b |
---|
| 79 | * are not able to handle #pragma interrupt correctly if more than 1 isr is |
---|
[50cf94da] | 80 | * contained in a file and when optimizing. |
---|
| 81 | * We try to work around this problem by using the macro below. |
---|
| 82 | */ |
---|
| 83 | #define isp( name, number, func)\ |
---|
| 84 | asm (".global _"Str(name)"\n\t" \ |
---|
| 85 | "_"Str(name)": \n\t" \ |
---|
| 86 | " mov.l r0,@-r15 \n\t" \ |
---|
| 87 | " mov.l r1,@-r15 \n\t" \ |
---|
| 88 | " mov.l r2,@-r15 \n\t" \ |
---|
| 89 | " mov.l r3,@-r15 \n\t" \ |
---|
| 90 | " mov.l r4,@-r15 \n\t" \ |
---|
| 91 | " mov.l r5,@-r15 \n\t" \ |
---|
| 92 | " mov.l r6,@-r15 \n\t" \ |
---|
| 93 | " mov.l r7,@-r15 \n\t" \ |
---|
| 94 | " mov.l r14,@-r15 \n\t" \ |
---|
| 95 | " sts.l pr,@-r15 \n\t" \ |
---|
| 96 | " sts.l mach,@-r15 \n\t" \ |
---|
| 97 | " sts.l macl,@-r15 \n\t" \ |
---|
| 98 | " mov r15,r14 \n\t" \ |
---|
| 99 | " mov.l "Str(name)"_k, r1\n\t" \ |
---|
| 100 | " jsr @r1 \n\t" \ |
---|
| 101 | " mov #"Str(number)", r4\n\t" \ |
---|
| 102 | " mov r14,r15 \n\t" \ |
---|
| 103 | " lds.l @r15+,macl \n\t" \ |
---|
| 104 | " lds.l @r15+,mach \n\t" \ |
---|
| 105 | " lds.l @r15+,pr \n\t" \ |
---|
| 106 | " mov.l @r15+,r14 \n\t" \ |
---|
| 107 | " mov.l @r15+,r7 \n\t" \ |
---|
| 108 | " mov.l @r15+,r6 \n\t" \ |
---|
| 109 | " mov.l @r15+,r5 \n\t" \ |
---|
| 110 | " mov.l @r15+,r4 \n\t" \ |
---|
| 111 | " mov.l @r15+,r3 \n\t" \ |
---|
| 112 | " mov.l @r15+,r2 \n\t" \ |
---|
| 113 | " mov.l @r15+,r1 \n\t" \ |
---|
| 114 | " mov.l @r15+,r0 \n\t" \ |
---|
| 115 | " rte \n\t" \ |
---|
| 116 | " nop \n\t" \ |
---|
| 117 | " .align 2 \n\t" \ |
---|
| 118 | #name"_k: \n\t" \ |
---|
| 119 | ".long "Str(func)); |
---|
| 120 | |
---|
| 121 | /************************************************ |
---|
| 122 | * Dummy interrupt service procedure for |
---|
| 123 | * interrupts being not allowed --> Trap 34 |
---|
| 124 | ************************************************/ |
---|
[13597a72] | 125 | asm(" .section .text\n\ |
---|
| 126 | .global __dummy_isp\n\ |
---|
| 127 | __dummy_isp:\n\ |
---|
| 128 | mov.l r14,@-r15\n\ |
---|
| 129 | mov r15, r14\n\ |
---|
| 130 | trapa #34\n\ |
---|
| 131 | mov.l @r15+,r14\n\ |
---|
| 132 | rte\n\ |
---|
[50cf94da] | 133 | nop"); |
---|
| 134 | |
---|
| 135 | /***************************** |
---|
| 136 | * Non maskable interrupt |
---|
| 137 | *****************************/ |
---|
| 138 | isp( _nmi_isp, NMI_ISP_V, ___ISR_Handler); |
---|
| 139 | |
---|
| 140 | /***************************** |
---|
| 141 | * User break controller |
---|
| 142 | *****************************/ |
---|
| 143 | isp( _usb_isp, USB_ISP_V, ___ISR_Handler); |
---|
| 144 | |
---|
| 145 | /***************************** |
---|
| 146 | * External interrupts 0-7 |
---|
| 147 | *****************************/ |
---|
| 148 | isp( _irq0_isp, IRQ0_ISP_V, ___ISR_Handler); |
---|
| 149 | isp( _irq1_isp, IRQ1_ISP_V, ___ISR_Handler); |
---|
| 150 | isp( _irq2_isp, IRQ2_ISP_V, ___ISR_Handler); |
---|
| 151 | isp( _irq3_isp, IRQ3_ISP_V, ___ISR_Handler); |
---|
| 152 | isp( _irq4_isp, IRQ4_ISP_V, ___ISR_Handler); |
---|
| 153 | isp( _irq5_isp, IRQ5_ISP_V, ___ISR_Handler); |
---|
| 154 | isp( _irq6_isp, IRQ6_ISP_V, ___ISR_Handler); |
---|
| 155 | isp( _irq7_isp, IRQ7_ISP_V, ___ISR_Handler); |
---|
| 156 | |
---|
| 157 | /***************************** |
---|
| 158 | * DMA - controller |
---|
| 159 | *****************************/ |
---|
| 160 | isp( _dma0_isp, DMA0_ISP_V, ___ISR_Handler); |
---|
| 161 | isp( _dma1_isp, DMA1_ISP_V, ___ISR_Handler); |
---|
| 162 | isp( _dma2_isp, DMA2_ISP_V, ___ISR_Handler); |
---|
| 163 | isp( _dma3_isp, DMA3_ISP_V, ___ISR_Handler); |
---|
| 164 | |
---|
| 165 | |
---|
| 166 | /***************************** |
---|
| 167 | * Interrupt timer unit |
---|
| 168 | *****************************/ |
---|
| 169 | |
---|
| 170 | /***************************** |
---|
| 171 | * Timer 0 |
---|
| 172 | *****************************/ |
---|
| 173 | isp( _imia0_isp, IMIA0_ISP_V, ___ISR_Handler); |
---|
| 174 | isp( _imib0_isp, IMIB0_ISP_V, ___ISR_Handler); |
---|
| 175 | isp( _ovi0_isp, OVI0_ISP_V, ___ISR_Handler); |
---|
| 176 | |
---|
| 177 | /***************************** |
---|
| 178 | * Timer 1 |
---|
| 179 | *****************************/ |
---|
| 180 | isp( _imia1_isp, IMIA1_ISP_V, ___ISR_Handler); |
---|
| 181 | isp( _imib1_isp, IMIB1_ISP_V, ___ISR_Handler); |
---|
| 182 | isp( _ovi1_isp, OVI1_ISP_V, ___ISR_Handler); |
---|
| 183 | |
---|
| 184 | /***************************** |
---|
| 185 | * Timer 2 |
---|
| 186 | *****************************/ |
---|
| 187 | isp( _imia2_isp, IMIA2_ISP_V, ___ISR_Handler); |
---|
| 188 | isp( _imib2_isp, IMIB2_ISP_V, ___ISR_Handler); |
---|
| 189 | isp( _ovi2_isp, OVI2_ISP_V, ___ISR_Handler); |
---|
| 190 | |
---|
| 191 | /***************************** |
---|
| 192 | * Timer 3 |
---|
| 193 | *****************************/ |
---|
| 194 | isp( _imia3_isp, IMIA3_ISP_V, ___ISR_Handler); |
---|
| 195 | isp( _imib3_isp, IMIB3_ISP_V, ___ISR_Handler); |
---|
| 196 | isp( _ovi3_isp, OVI3_ISP_V, ___ISR_Handler); |
---|
| 197 | |
---|
| 198 | /***************************** |
---|
| 199 | * Timer 4 |
---|
| 200 | *****************************/ |
---|
| 201 | isp( _imia4_isp, IMIA4_ISP_V, ___ISR_Handler); |
---|
| 202 | isp( _imib4_isp, IMIB4_ISP_V, ___ISR_Handler); |
---|
| 203 | isp( _ovi4_isp, OVI4_ISP_V, ___ISR_Handler); |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | /***************************** |
---|
| 207 | * Serial interfaces |
---|
| 208 | *****************************/ |
---|
| 209 | |
---|
| 210 | /***************************** |
---|
| 211 | * Serial interface 0 |
---|
| 212 | *****************************/ |
---|
| 213 | isp( _eri0_isp, ERI0_ISP_V, ___ISR_Handler); |
---|
| 214 | isp( _rxi0_isp, RXI0_ISP_V, ___ISR_Handler); |
---|
| 215 | isp( _txi0_isp, TXI0_ISP_V, ___ISR_Handler); |
---|
| 216 | isp( _tei0_isp, TEI0_ISP_V, ___ISR_Handler); |
---|
| 217 | |
---|
| 218 | /***************************** |
---|
| 219 | * Serial interface 1 |
---|
| 220 | *****************************/ |
---|
| 221 | isp( _eri1_isp, ERI1_ISP_V, ___ISR_Handler); |
---|
| 222 | isp( _rxi1_isp, RXI1_ISP_V, ___ISR_Handler); |
---|
| 223 | isp( _txi1_isp, TXI1_ISP_V, ___ISR_Handler); |
---|
| 224 | isp( _tei1_isp, TEI1_ISP_V, ___ISR_Handler); |
---|
| 225 | |
---|
| 226 | |
---|
| 227 | /***************************** |
---|
| 228 | * Parity control unit of |
---|
| 229 | * the bus state controller |
---|
| 230 | *****************************/ |
---|
| 231 | isp( _prt_isp, PRT_ISP_V, ___ISR_Handler); |
---|
| 232 | |
---|
| 233 | |
---|
| 234 | /****************************** |
---|
| 235 | * Analog digital converter |
---|
| 236 | * ADC |
---|
| 237 | ******************************/ |
---|
| 238 | isp( _adu_isp, ADU_ISP_V, ___ISR_Handler); |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | /****************************** |
---|
| 242 | * Watchdog timer |
---|
| 243 | ******************************/ |
---|
| 244 | isp( _wdt_isp, WDT_ISP_V, ___ISR_Handler); |
---|
| 245 | |
---|
| 246 | |
---|
| 247 | /****************************** |
---|
| 248 | * DRAM refresh control unit |
---|
| 249 | * of bus state controller |
---|
| 250 | ******************************/ |
---|
| 251 | isp( _dref_isp, DREF_ISP_V, ___ISR_Handler); |
---|