OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [score/] [cpu/] [sh/] [ispsh7032.c] - Blame information for rev 173

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.