source: rtems/c/src/lib/libbsp/sh/gensh1/startup/ispsh7032.c @ 0706581

5
Last change on this file since 0706581 was 0706581, checked in by Joel Sherrill <joel@…>, on 03/07/18 at 20:31:31

misc sh: Remove includes of rtems/score/types.h

  • Property mode set to 100644
File size: 7.7 KB
Line 
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.rtems.org/license/LICENSE.
26 */
27
28#include <rtems/system.h>
29#include <rtems/score/ispsh7032.h>
30
31/*
32 * This is an exception vector table
33 *
34 * It has the same structure like the actual vector table (vectab)
35 */
36proc_ptr _Hardware_isr_Table[256]={
37_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
38_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
39_dummy_isp, _dummy_isp, _dummy_isp,
40_nmi_isp, _usb_isp,
41_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
42_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
43_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
44_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
45_dummy_isp, _dummy_isp, _dummy_isp,
46/* trapa 0 -31 */
47_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
48_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
49_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
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/* irq 64 ... */
56_irq0_isp, _irq1_isp, _irq2_isp, _irq3_isp,
57_irq4_isp, _irq5_isp, _irq6_isp, _irq7_isp,
58_dma0_isp, _dummy_isp, _dma1_isp, _dummy_isp,
59_dma2_isp, _dummy_isp, _dma3_isp, _dummy_isp,
60_imia0_isp, _imib0_isp, _ovi0_isp, _dummy_isp,
61_imia1_isp, _imib1_isp, _ovi1_isp, _dummy_isp,
62_imia2_isp, _imib2_isp, _ovi2_isp, _dummy_isp,
63_imia3_isp, _imib3_isp, _ovi3_isp, _dummy_isp,
64_imia4_isp, _imib4_isp, _ovi4_isp, _dummy_isp,
65_eri0_isp, _rxi0_isp, _txi0_isp, _tei0_isp,
66_eri1_isp, _rxi1_isp, _txi1_isp, _tei1_isp,
67_prt_isp, _adu_isp, _dummy_isp, _dummy_isp,
68_wdt_isp,
69/* 113 */ _dref_isp
70};
71
72#define Str(a)#a
73
74/*
75 * Some versions of gcc and all version of egcs at least until egcs-1.1b
76 * are not able to handle #pragma interrupt correctly if more than 1 isr is
77 * contained in a file and when optimizing.
78 * We try to work around this problem by using the macro below.
79 */
80#define isp( name, number, func)\
81__asm__ (".global _"Str(name)"\n\t" \
82     "_"Str(name)":       \n\t" \
83     "    mov.l r0,@-r15   \n\t" \
84     "    mov.l r1,@-r15   \n\t" \
85     "    mov.l r2,@-r15   \n\t" \
86     "    mov.l r3,@-r15   \n\t" \
87     "    mov.l r4,@-r15   \n\t" \
88     "    mov.l r5,@-r15   \n\t" \
89     "    mov.l r6,@-r15   \n\t" \
90     "    mov.l r7,@-r15   \n\t" \
91     "    mov.l r14,@-r15  \n\t" \
92     "    sts.l pr,@-r15   \n\t" \
93     "    sts.l mach,@-r15 \n\t" \
94     "    sts.l macl,@-r15 \n\t" \
95     "    mov r15,r14      \n\t" \
96     "    mov.l "Str(name)"_k, r1\n\t" \
97     "    jsr @r1           \n\t" \
98     "    mov #"Str(number)", r4\n\t" \
99     "    mov   r14,r15    \n\t" \
100     "    lds.l @r15+,macl \n\t" \
101     "    lds.l @r15+,mach \n\t" \
102     "    lds.l @r15+,pr   \n\t" \
103     "    mov.l @r15+,r14  \n\t" \
104     "    mov.l @r15+,r7   \n\t" \
105     "    mov.l @r15+,r6   \n\t" \
106     "    mov.l @r15+,r5   \n\t" \
107     "    mov.l @r15+,r4   \n\t" \
108     "    mov.l @r15+,r3   \n\t" \
109     "    mov.l @r15+,r2   \n\t" \
110     "    mov.l @r15+,r1   \n\t" \
111     "    mov.l @r15+,r0   \n\t" \
112     "    rte              \n\t" \
113     "    nop              \n\t" \
114     "    .align 2         \n\t" \
115     #name"_k: \n\t" \
116     ".long "Str(func));
117
118/************************************************
119 * Dummy interrupt service procedure for
120 * interrupts being not allowed --> Trap 34
121 ************************************************/
122__asm__ (" .section .text\n\
123.global __dummy_isp\n\
124__dummy_isp:\n\
125      mov.l r14,@-r15\n\
126      mov   r15, r14\n\
127      trapa #34\n\
128      mov.l @r15+,r14\n\
129      rte\n\
130      nop");
131
132/*****************************
133 * Non maskable interrupt
134 *****************************/
135isp( _nmi_isp, NMI_ISP_V, ___ISR_Handler);
136
137/*****************************
138 * User break controller
139 *****************************/
140isp( _usb_isp, USB_ISP_V, ___ISR_Handler);
141
142/*****************************
143 *  External interrupts 0-7
144 *****************************/
145isp( _irq0_isp, IRQ0_ISP_V, ___ISR_Handler);
146isp( _irq1_isp, IRQ1_ISP_V, ___ISR_Handler);
147isp( _irq2_isp, IRQ2_ISP_V, ___ISR_Handler);
148isp( _irq3_isp, IRQ3_ISP_V, ___ISR_Handler);
149isp( _irq4_isp, IRQ4_ISP_V, ___ISR_Handler);
150isp( _irq5_isp, IRQ5_ISP_V, ___ISR_Handler);
151isp( _irq6_isp, IRQ6_ISP_V, ___ISR_Handler);
152isp( _irq7_isp, IRQ7_ISP_V, ___ISR_Handler);
153
154/*****************************
155 * DMA - controller
156 *****************************/
157isp( _dma0_isp, DMA0_ISP_V, ___ISR_Handler);
158isp( _dma1_isp, DMA1_ISP_V, ___ISR_Handler);
159isp( _dma2_isp, DMA2_ISP_V, ___ISR_Handler);
160isp( _dma3_isp, DMA3_ISP_V, ___ISR_Handler);
161
162
163/*****************************
164 * Interrupt timer unit
165 *****************************/
166
167/*****************************
168 * Timer 0
169 *****************************/
170isp( _imia0_isp, IMIA0_ISP_V, ___ISR_Handler);
171isp( _imib0_isp, IMIB0_ISP_V, ___ISR_Handler);
172isp( _ovi0_isp,  OVI0_ISP_V, ___ISR_Handler);
173
174/*****************************
175 * Timer 1
176 *****************************/
177isp( _imia1_isp, IMIA1_ISP_V, ___ISR_Handler);
178isp( _imib1_isp, IMIB1_ISP_V, ___ISR_Handler);
179isp( _ovi1_isp,  OVI1_ISP_V, ___ISR_Handler);
180
181/*****************************
182 * Timer 2
183 *****************************/
184isp( _imia2_isp, IMIA2_ISP_V, ___ISR_Handler);
185isp( _imib2_isp, IMIB2_ISP_V, ___ISR_Handler);
186isp( _ovi2_isp,  OVI2_ISP_V, ___ISR_Handler);
187
188/*****************************
189 * Timer 3
190 *****************************/
191isp( _imia3_isp, IMIA3_ISP_V, ___ISR_Handler);
192isp( _imib3_isp, IMIB3_ISP_V, ___ISR_Handler);
193isp( _ovi3_isp,  OVI3_ISP_V, ___ISR_Handler);
194
195/*****************************
196 * Timer 4
197 *****************************/
198isp( _imia4_isp, IMIA4_ISP_V, ___ISR_Handler);
199isp( _imib4_isp, IMIB4_ISP_V, ___ISR_Handler);
200isp( _ovi4_isp,  OVI4_ISP_V, ___ISR_Handler);
201
202
203/*****************************
204 * Serial interfaces
205 *****************************/
206
207/*****************************
208 * Serial interface 0
209 *****************************/
210isp( _eri0_isp,  ERI0_ISP_V, ___ISR_Handler);
211isp( _rxi0_isp,  RXI0_ISP_V, ___ISR_Handler);
212isp( _txi0_isp,  TXI0_ISP_V, ___ISR_Handler);
213isp( _tei0_isp,  TEI0_ISP_V, ___ISR_Handler);
214
215/*****************************
216 * Serial interface 1
217 *****************************/
218isp( _eri1_isp,  ERI1_ISP_V, ___ISR_Handler);
219isp( _rxi1_isp,  RXI1_ISP_V, ___ISR_Handler);
220isp( _txi1_isp,  TXI1_ISP_V, ___ISR_Handler);
221isp( _tei1_isp,  TEI1_ISP_V, ___ISR_Handler);
222
223
224/*****************************
225 * Parity control unit of
226 * the bus state controller
227 *****************************/
228isp( _prt_isp,  PRT_ISP_V, ___ISR_Handler);
229
230
231/******************************
232 * Analog digital converter
233 * ADC
234 ******************************/
235isp( _adu_isp,  ADU_ISP_V, ___ISR_Handler);
236
237
238/******************************
239 *  Watchdog timer
240 ******************************/
241isp( _wdt_isp,  WDT_ISP_V, ___ISR_Handler);
242
243
244/******************************
245 * DRAM refresh control unit
246 * of bus state controller
247 ******************************/
248isp( _dref_isp,  DREF_ISP_V, ___ISR_Handler);
Note: See TracBrowser for help on using the repository browser.