aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-10-11 23:03:04 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-10-11 23:03:04 -0400
commitbaf4326e49801526e4516e4de7f37b5e51468c49 (patch)
tree44fc3dd7c68827613cf0bcfcf2f4edacc63b1ea1 /arch
parent8884c4cb8b621963b5eb4a9ae45070bd0cb7085f (diff)
sh: interrupt exception handling rework
Kill off interrupt_table for all of the CPU subtypes, we now default in to stepping in to do_IRQ() for _all_ IRQ exceptions and counting the spurious ones, rather than simply flipping on the ones we cared about. This and enabling the IRQ by default automatically has already uncovered a couple of bugs and IRQs that weren't being caught, as well as some that are being generated far too often (SCI Tx Data Empty, for example). The general rationale is to use a marker for interrupt exceptions, test for it in the handle_exception() path, and skip out to do_IRQ() if it's found. Everything else follows the same behaviour of finding the cached EXPEVT value in r2/r2_bank, we just rip out the INTEVT read from entry.S entirely (except for in the kGDB NMI case, which is another matter). Note that while this changes the do_IRQ() semantics regarding r4 handling, they were fundamentally broken anyways (relying entirely on r2_bank for the cached code). With this, we do the INTEVT read from do_IRQ() itself (in the CONFIG_CPU_HAS_INTEVT case), or fall back on r4 for the muxed IRQ number, which should also be closer to what SH-2 and SH-2A want anyways. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/cpu/sh3/ex.S195
-rw-r--r--arch/sh/kernel/cpu/sh4/ex.S500
-rw-r--r--arch/sh/kernel/entry.S43
-rw-r--r--arch/sh/kernel/irq.c23
4 files changed, 40 insertions, 721 deletions
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S
index 44daf44833f9..6be46f0686b7 100644
--- a/arch/sh/kernel/cpu/sh3/ex.S
+++ b/arch/sh/kernel/cpu/sh3/ex.S
@@ -49,198 +49,3 @@ ENTRY(nmi_slot)
49#endif 49#endif
50ENTRY(user_break_point_trap) 50ENTRY(user_break_point_trap)
51 .long break_point_trap /* 1E0 */ 51 .long break_point_trap /* 1E0 */
52ENTRY(interrupt_table)
53 ! external hardware
54 .long do_IRQ ! 0000 /* 200 */
55 .long do_IRQ ! 0001
56 .long do_IRQ ! 0010
57 .long do_IRQ ! 0011
58 .long do_IRQ ! 0100
59 .long do_IRQ ! 0101
60 .long do_IRQ ! 0110
61 .long do_IRQ ! 0111
62 .long do_IRQ ! 1000 /* 300 */
63 .long do_IRQ ! 1001
64 .long do_IRQ ! 1010
65 .long do_IRQ ! 1011
66 .long do_IRQ ! 1100
67 .long do_IRQ ! 1101
68 .long do_IRQ ! 1110
69 .long exception_error
70 ! Internal hardware
71 .long do_IRQ ! TMU0 tuni0 /* 400 */
72 .long do_IRQ ! TMU1 tuni1
73 .long do_IRQ ! TMU2 tuni2
74 .long do_IRQ ! ticpi2
75 .long do_IRQ ! RTC ati
76 .long do_IRQ ! pri
77 .long do_IRQ ! cui
78 .long do_IRQ ! SCI eri
79 .long do_IRQ ! rxi /* 500 */
80 .long do_IRQ ! txi
81 .long do_IRQ ! tei
82 .long do_IRQ ! WDT iti /* 560 */
83 .long do_IRQ ! REF rcmi
84 .long do_IRQ ! rovi
85 .long do_IRQ
86 .long do_IRQ /* 5E0 */
87#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
88 defined(CONFIG_CPU_SUBTYPE_SH7709) || \
89 defined(CONFIG_CPU_SUBTYPE_SH7706) || \
90 defined(CONFIG_CPU_SUBTYPE_SH7300) || \
91 defined(CONFIG_CPU_SUBTYPE_SH7705) || \
92 defined(CONFIG_CPU_SUBTYPE_SH7710)
93 .long do_IRQ ! 32 IRQ irq0 /* 600 */
94 .long do_IRQ ! 33 irq1
95 .long do_IRQ ! 34 irq2
96 .long do_IRQ ! 35 irq3
97 .long do_IRQ ! 36 irq4
98 .long do_IRQ ! 37 irq5
99 .long do_IRQ ! 38
100 .long do_IRQ ! 39
101 .long do_IRQ ! 40 PINT pint0-7 /* 700 */
102 .long do_IRQ ! 41 pint8-15
103 .long do_IRQ ! 42
104 .long do_IRQ ! 43
105 .long do_IRQ ! 44
106 .long do_IRQ ! 45
107 .long do_IRQ ! 46
108 .long do_IRQ ! 47
109 .long do_IRQ ! 48 DMAC dei0 /* 800 */
110 .long do_IRQ ! 49 dei1
111 .long do_IRQ ! 50 dei2
112 .long do_IRQ ! 51 dei3
113 .long do_IRQ ! 52 IrDA eri1
114 .long do_IRQ ! 53 rxi1
115 .long do_IRQ ! 54 bri1
116 .long do_IRQ ! 55 txi1
117 .long do_IRQ ! 56 SCIF eri2
118 .long do_IRQ ! 57 rxi2
119 .long do_IRQ ! 58 bri2
120 .long do_IRQ ! 59 txi2
121 .long do_IRQ ! 60 ADC adi /* 980 */
122#if defined(CONFIG_CPU_SUBTYPE_SH7705)
123 .long exception_none ! 61 /* 9A0 */
124 .long exception_none ! 62
125 .long exception_none ! 63
126 .long exception_none ! 64 /* A00 */
127 .long do_IRQ ! 65 USB usi0
128 .long do_IRQ ! 66 usi1
129 .long exception_none ! 67
130 .long exception_none ! 68
131 .long exception_none ! 69
132 .long exception_none ! 70
133 .long exception_none ! 71
134 .long exception_none ! 72 /* B00 */
135 .long exception_none ! 73
136 .long exception_none ! 74
137 .long exception_none ! 75
138 .long exception_none ! 76
139 .long exception_none ! 77
140 .long exception_none ! 78
141 .long exception_none ! 79
142 .long do_IRQ ! 80 TPU0 tpi0 /* C00 */
143 .long do_IRQ ! 81 TPU1 tpi1
144 .long exception_none ! 82
145 .long exception_none ! 83
146 .long do_IRQ ! 84 TPU2 tpi2
147 .long do_IRQ ! 85 TPU3 tpi3 /* CA0 */
148#endif
149#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7300)
150 .long do_IRQ ! 61 LCDC lcdi /* 9A0 */
151 .long do_IRQ ! 62 PCC pcc0i
152 .long do_IRQ ! 63 pcc1i /* 9E0 */
153#endif
154#if defined(CONFIG_CPU_SUBTYPE_SH7710)
155 .long exception_none ! 61 /* 9A0 */
156 .long exception_none ! 62
157 .long exception_none ! 63
158 .long exception_none ! 64 /* A00 */
159 .long exception_none ! 65
160 .long exception_none ! 66
161 .long exception_none ! 67
162 .long exception_none ! 68
163 .long exception_none ! 69
164 .long exception_none ! 70
165 .long exception_none ! 71
166 .long exception_none ! 72 /* B00 */
167 .long exception_none ! 73
168 .long exception_none ! 74
169 .long exception_none ! 75
170 .long do_IRQ ! 76 DMAC2 dei4 /* B80 */
171 .long do_IRQ ! 77 DMAC2 dei5
172 .long exception_none ! 78
173 .long do_IRQ ! 79 IPSEC ipseci /* BE0 */
174 .long do_IRQ ! 80 EDMAC eint0 /* C00 */
175 .long do_IRQ ! 81 EDMAC eint1
176 .long do_IRQ ! 82 EDMAC eint2
177 .long exception_none ! 83 /* C60 */
178 .long exception_none ! 84
179 .long exception_none ! 85
180 .long exception_none ! 86
181 .long exception_none ! 87
182 .long exception_none ! 88 /* D00 */
183 .long exception_none ! 89
184 .long exception_none ! 90
185 .long exception_none ! 91
186 .long exception_none ! 92
187 .long exception_none ! 93
188 .long exception_none ! 94
189 .long exception_none ! 95
190 .long do_IRQ ! 96 SIOF eri0 /* E00 */
191 .long do_IRQ ! 97 txi0
192 .long do_IRQ ! 98 rxi0
193 .long do_IRQ ! 99 cci0
194 .long do_IRQ ! 100 eri1 /* E80 */
195 .long do_IRQ ! 101 txi1
196 .long do_IRQ ! 102 rxi2
197 .long do_IRQ ! 103 cci3
198#endif
199#if defined(CONFIG_CPU_SUBTYPE_SH7300)
200 .long do_IRQ ! 64
201 .long do_IRQ ! 65
202 .long do_IRQ ! 66
203 .long do_IRQ ! 67
204 .long do_IRQ ! 68
205 .long do_IRQ ! 69
206 .long do_IRQ ! 70
207 .long do_IRQ ! 71
208 .long do_IRQ ! 72
209 .long do_IRQ ! 73
210 .long do_IRQ ! 74
211 .long do_IRQ ! 75
212 .long do_IRQ ! 76
213 .long do_IRQ ! 77
214 .long do_IRQ ! 78
215 .long do_IRQ ! 79
216 .long do_IRQ ! 80 SCIF0(SH7300)
217 .long do_IRQ ! 81
218 .long do_IRQ ! 82
219 .long do_IRQ ! 83
220 .long do_IRQ ! 84
221 .long do_IRQ ! 85
222 .long do_IRQ ! 86
223 .long do_IRQ ! 87
224 .long do_IRQ ! 88
225 .long do_IRQ ! 89
226 .long do_IRQ ! 90
227 .long do_IRQ ! 91
228 .long do_IRQ ! 92
229 .long do_IRQ ! 93
230 .long do_IRQ ! 94
231 .long do_IRQ ! 95
232 .long do_IRQ ! 96
233 .long do_IRQ ! 97
234 .long do_IRQ ! 98
235 .long do_IRQ ! 99
236 .long do_IRQ ! 100
237 .long do_IRQ ! 101
238 .long do_IRQ ! 102
239 .long do_IRQ ! 103
240 .long do_IRQ ! 104
241 .long do_IRQ ! 105
242 .long do_IRQ ! 106
243 .long do_IRQ ! 107
244 .long do_IRQ ! 108
245#endif
246#endif
diff --git a/arch/sh/kernel/cpu/sh4/ex.S b/arch/sh/kernel/cpu/sh4/ex.S
index 7146893a6cca..3f4cd043e900 100644
--- a/arch/sh/kernel/cpu/sh4/ex.S
+++ b/arch/sh/kernel/cpu/sh4/ex.S
@@ -53,503 +53,3 @@ ENTRY(nmi_slot)
53#endif 53#endif
54ENTRY(user_break_point_trap) 54ENTRY(user_break_point_trap)
55 .long break_point_trap /* 1E0 */ 55 .long break_point_trap /* 1E0 */
56ENTRY(interrupt_table)
57 ! external hardware
58 .long do_IRQ ! 0000 /* 200 */
59 .long do_IRQ ! 0001
60 .long do_IRQ ! 0010
61 .long do_IRQ ! 0011
62 .long do_IRQ ! 0100
63 .long do_IRQ ! 0101
64 .long do_IRQ ! 0110
65 .long do_IRQ ! 0111
66 .long do_IRQ ! 1000 /* 300 */
67 .long do_IRQ ! 1001
68 .long do_IRQ ! 1010
69 .long do_IRQ ! 1011
70 .long do_IRQ ! 1100
71 .long do_IRQ ! 1101
72 .long do_IRQ ! 1110
73 .long exception_error
74 ! Internal hardware
75#ifndef CONFIG_CPU_SUBTYPE_SH7780
76 .long do_IRQ ! TMU0 tuni0 /* 400 */
77 .long do_IRQ ! TMU1 tuni1
78 .long do_IRQ ! TMU2 tuni2
79 .long do_IRQ ! ticpi2
80#if defined(CONFIG_CPU_SUBTYPE_SH7760)
81 .long exception_error
82 .long exception_error
83 .long exception_error
84 .long exception_error
85 .long exception_error /* 500 */
86 .long exception_error
87 .long exception_error
88#else
89 .long do_IRQ ! RTC ati
90 .long do_IRQ ! pri
91 .long do_IRQ ! cui
92 .long do_IRQ ! SCI eri
93 .long do_IRQ ! rxi /* 500 */
94 .long do_IRQ ! txi
95 .long do_IRQ ! tei
96#endif
97 .long do_IRQ ! WDT iti /* 560 */
98 .long do_IRQ ! REF rcmi
99 .long do_IRQ ! rovi
100 .long do_IRQ
101 .long do_IRQ /* 5E0 */
102 .long do_IRQ ! 32 Hitachi UDI /* 600 */
103 .long do_IRQ ! 33 GPIO
104 .long do_IRQ ! 34 DMAC dmte0
105 .long do_IRQ ! 35 dmte1
106 .long do_IRQ ! 36 dmte2
107 .long do_IRQ ! 37 dmte3
108 .long do_IRQ ! 38 dmae
109 .long exception_error ! 39 /* 6E0 */
110#if defined(CONFIG_CPU_SUBTYPE_SH7760)
111 .long exception_error /* 700 */
112 .long exception_error
113 .long exception_error
114 .long exception_error /* 760 */
115#else
116 .long do_IRQ ! 40 SCIF eri /* 700 */
117 .long do_IRQ ! 41 rxi
118 .long do_IRQ ! 42 bri
119 .long do_IRQ ! 43 txi
120#endif
121#if CONFIG_NR_ONCHIP_DMA_CHANNELS == 8
122 .long do_IRQ ! 44 DMAC dmte4 /* 780 */
123 .long do_IRQ ! 45 dmte5
124 .long do_IRQ ! 46 dmte6
125 .long do_IRQ ! 47 dmte7 /* 7E0 */
126#elif defined(CONFIG_CPU_SUBTYPE_SH7343)
127 .long do_IRQ ! 44 IIC1 ali /* 780 */
128 .long do_IRQ ! 45 tacki
129 .long do_IRQ ! 46 waiti
130 .long do_IRQ ! 47 dtei /* 7E0 */
131 .long do_IRQ ! 48 DMAC dei0 /* 800 */
132 .long do_IRQ ! 49 dei1 /* 820 */
133#else
134 .long exception_error ! 44 /* 780 */
135 .long exception_error ! 45
136 .long exception_error ! 46
137 .long exception_error ! 47
138#endif
139#if defined(CONFIG_SH_FPU)
140 .long do_fpu_state_restore ! 48 /* 800 */
141 .long do_fpu_state_restore ! 49 /* 820 */
142#elif !defined(CONFIG_CPU_SUBTYPE_SH7343) && \
143 !defined(CONFIG_CPU_SUBTYPE_SH73180)
144 .long exception_error
145 .long exception_error
146#endif
147#if defined(CONFIG_CPU_SUBTYPE_SH7751)
148 .long exception_error /* 840 */
149 .long exception_error
150 .long exception_error
151 .long exception_error
152 .long exception_error
153 .long exception_error
154 .long exception_error /* 900 */
155 .long exception_error
156 .long exception_error
157 .long exception_error
158 .long exception_error
159 .long exception_error
160 .long exception_error
161 .long exception_error
162 .long do_IRQ ! PCI serr /* A00 */
163 .long do_IRQ ! dma3
164 .long do_IRQ ! dma2
165 .long do_IRQ ! dma1
166 .long do_IRQ ! dma0
167 .long do_IRQ ! pwon
168 .long do_IRQ ! pwdwn
169 .long do_IRQ ! err
170 .long do_IRQ ! TMU3 tuni3 /* B00 */
171 .long exception_error
172 .long exception_error
173 .long exception_error
174 .long do_IRQ ! TMU4 tuni4 /* B80 */
175#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
176 .long do_IRQ ! IRQ irq6 /* 840 */
177 .long do_IRQ ! irq7
178 .long do_IRQ ! SCIF eri0
179 .long do_IRQ ! rxi0
180 .long do_IRQ ! bri0
181 .long do_IRQ ! txi0
182 .long do_IRQ ! HCAN2 cani0 /* 900 */
183 .long do_IRQ ! cani1
184 .long do_IRQ ! SSI ssii0
185 .long do_IRQ ! ssii1
186 .long do_IRQ ! HAC haci0
187 .long do_IRQ ! haci1
188 .long do_IRQ ! IIC iici0
189 .long do_IRQ ! iici1
190 .long do_IRQ ! USB usbi /* A00 */
191 .long do_IRQ ! LCDC vint
192 .long exception_error
193 .long exception_error
194 .long do_IRQ ! DMABRG dmabrgi0
195 .long do_IRQ ! dmabrgi1
196 .long do_IRQ ! dmabrgi2
197 .long exception_error
198 .long do_IRQ ! SCIF eri1 /* B00 */
199 .long do_IRQ ! rxi1
200 .long do_IRQ ! bri1
201 .long do_IRQ ! txi1
202 .long do_IRQ ! eri2
203 .long do_IRQ ! rxi2
204 .long do_IRQ ! bri2
205 .long do_IRQ ! txi2
206 .long do_IRQ ! SIM simeri /* C00 */
207 .long do_IRQ ! simrxi
208 .long do_IRQ ! simtxi
209 .long do_IRQ ! simtei
210 .long do_IRQ ! HSPI spii
211 .long exception_error
212 .long exception_error
213 .long exception_error
214 .long do_IRQ ! MMCIF mmci0 /* D00 */
215 .long do_IRQ ! mmci1
216 .long do_IRQ ! mmci2
217 .long do_IRQ ! mmci3
218 .long exception_error
219 .long exception_error
220 .long exception_error
221 .long exception_error
222 .long exception_error /* E00 */
223 .long exception_error
224 .long exception_error
225 .long exception_error
226 .long do_IRQ ! MFI mfii
227 .long exception_error
228 .long exception_error
229 .long exception_error
230 .long exception_error /* F00 */
231 .long exception_error
232 .long exception_error
233 .long exception_error
234 .long do_IRQ ! ADC adi
235 .long do_IRQ ! CMT cmti /* FA0 */
236#elif defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7343)
237 .long do_IRQ ! 50 0x840
238 .long do_IRQ ! 51 0x860
239 .long do_IRQ ! 52 0x880
240 .long do_IRQ ! 53 0x8a0
241 .long do_IRQ ! 54 0x8c0
242 .long do_IRQ ! 55 0x8e0
243 .long do_IRQ ! 56 0x900
244 .long do_IRQ ! 57 0x920
245 .long do_IRQ ! 58 0x940
246 .long do_IRQ ! 59 0x960
247 .long do_IRQ ! 60 0x980
248 .long do_IRQ ! 61 0x9a0
249 .long do_IRQ ! 62 0x9c0
250 .long do_IRQ ! 63 0x9e0
251 .long do_IRQ ! 64 0xa00
252 .long do_IRQ ! 65 0xa20
253 .long do_IRQ ! 66 0xa40
254 .long do_IRQ ! 67 0xa60
255 .long do_IRQ ! 68 0xa80
256 .long do_IRQ ! 69 0xaa0
257 .long do_IRQ ! 70 0xac0
258 .long do_IRQ ! 71 0xae0
259 .long do_IRQ ! 72 0xb00
260 .long do_IRQ ! 73 0xb20
261 .long do_IRQ ! 74 0xb40
262 .long do_IRQ ! 75 0xb60
263 .long do_IRQ ! 76 0xb80
264 .long do_IRQ ! 77 0xba0
265 .long do_IRQ ! 78 0xbc0
266 .long do_IRQ ! 79 0xbe0
267 .long do_IRQ ! 80 0xc00
268 .long do_IRQ ! 81 0xc20
269 .long do_IRQ ! 82 0xc40
270 .long do_IRQ ! 83 0xc60
271 .long do_IRQ ! 84 0xc80
272 .long do_IRQ ! 85 0xca0
273 .long do_IRQ ! 86 0xcc0
274 .long do_IRQ ! 87 0xce0
275 .long do_IRQ ! 88 0xd00
276 .long do_IRQ ! 89 0xd20
277 .long do_IRQ ! 90 0xd40
278 .long do_IRQ ! 91 0xd60
279 .long do_IRQ ! 92 0xd80
280 .long do_IRQ ! 93 0xda0
281 .long do_IRQ ! 94 0xdc0
282 .long do_IRQ ! 95 0xde0
283 .long do_IRQ ! 96 0xe00
284 .long do_IRQ ! 97 0xe20
285 .long do_IRQ ! 98 0xe40
286 .long do_IRQ ! 99 0xe60
287 .long do_IRQ ! 100 0xe80
288 .long do_IRQ ! 101 0xea0
289 .long do_IRQ ! 102 0xec0
290 .long do_IRQ ! 103 0xee0
291 .long do_IRQ ! 104 0xf00
292 .long do_IRQ ! 105 0xf20
293 .long do_IRQ ! 106 0xf40
294 .long do_IRQ ! 107 0xf60
295 .long do_IRQ ! 108 0xf80
296#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
297 .long exception_error ! 50 0x840
298 .long exception_error ! 51 0x860
299 .long exception_error ! 52 0x880
300 .long exception_error ! 53 0x8a0
301 .long exception_error ! 54 0x8c0
302 .long exception_error ! 55 0x8e0
303 .long exception_error ! 56 0x900
304 .long exception_error ! 57 0x920
305 .long exception_error ! 58 0x940
306 .long exception_error ! 59 0x960
307 .long exception_error ! 60 0x980
308 .long exception_error ! 61 0x9a0
309 .long exception_error ! 62 0x9c0
310 .long exception_error ! 63 0x9e0
311 .long do_IRQ ! 64 0xa00 PCI serr
312 .long do_IRQ ! 65 0xa20 err
313 .long do_IRQ ! 66 0xa40 ad
314 .long do_IRQ ! 67 0xa60 pwr_dwn
315 .long exception_error ! 68 0xa80
316 .long exception_error ! 69 0xaa0
317 .long exception_error ! 70 0xac0
318 .long exception_error ! 71 0xae0
319 .long do_IRQ ! 72 0xb00 DMA INT0
320 .long do_IRQ ! 73 0xb20 INT1
321 .long do_IRQ ! 74 0xb40 INT2
322 .long do_IRQ ! 75 0xb60 INT3
323 .long do_IRQ ! 76 0xb80 INT4
324 .long exception_error ! 77 0xba0
325 .long do_IRQ ! 78 0xbc0 DMA ERR
326 .long exception_error ! 79 0xbe0
327 .long do_IRQ ! 80 0xc00 PIO0
328 .long do_IRQ ! 81 0xc20 PIO1
329 .long do_IRQ ! 82 0xc40 PIO2
330 .long exception_error ! 83 0xc60
331 .long exception_error ! 84 0xc80
332 .long exception_error ! 85 0xca0
333 .long exception_error ! 86 0xcc0
334 .long exception_error ! 87 0xce0
335 .long exception_error ! 88 0xd00
336 .long exception_error ! 89 0xd20
337 .long exception_error ! 90 0xd40
338 .long exception_error ! 91 0xd60
339 .long exception_error ! 92 0xd80
340 .long exception_error ! 93 0xda0
341 .long exception_error ! 94 0xdc0
342 .long exception_error ! 95 0xde0
343 .long exception_error ! 96 0xe00
344 .long exception_error ! 97 0xe20
345 .long exception_error ! 98 0xe40
346 .long exception_error ! 99 0xe60
347 .long exception_error ! 100 0xe80
348 .long exception_error ! 101 0xea0
349 .long exception_error ! 102 0xec0
350 .long exception_error ! 103 0xee0
351 .long exception_error ! 104 0xf00
352 .long exception_error ! 105 0xf20
353 .long exception_error ! 106 0xf40
354 .long exception_error ! 107 0xf60
355 .long exception_error ! 108 0xf80
356 .long exception_error ! 109 0xfa0
357 .long exception_error ! 110 0xfc0
358 .long exception_error ! 111 0xfe0
359 .long do_IRQ ! 112 0x1000 Mailbox
360 .long exception_error ! 113 0x1020
361 .long exception_error ! 114 0x1040
362 .long exception_error ! 115 0x1060
363 .long exception_error ! 116 0x1080
364 .long exception_error ! 117 0x10a0
365 .long exception_error ! 118 0x10c0
366 .long exception_error ! 119 0x10e0
367 .long exception_error ! 120 0x1100
368 .long exception_error ! 121 0x1120
369 .long exception_error ! 122 0x1140
370 .long exception_error ! 123 0x1160
371 .long exception_error ! 124 0x1180
372 .long exception_error ! 125 0x11a0
373 .long exception_error ! 126 0x11c0
374 .long exception_error ! 127 0x11e0
375 .long exception_error ! 128 0x1200
376 .long exception_error ! 129 0x1220
377 .long exception_error ! 130 0x1240
378 .long exception_error ! 131 0x1260
379 .long exception_error ! 132 0x1280
380 .long exception_error ! 133 0x12a0
381 .long exception_error ! 134 0x12c0
382 .long exception_error ! 135 0x12e0
383 .long exception_error ! 136 0x1300
384 .long exception_error ! 137 0x1320
385 .long exception_error ! 138 0x1340
386 .long exception_error ! 139 0x1360
387 .long do_IRQ ! 140 0x1380 EMPI INV_ADDR
388 .long exception_error ! 141 0x13a0
389 .long exception_error ! 142 0x13c0
390 .long exception_error ! 143 0x13e0
391#elif defined(CONFIG_CPU_SUBTYPE_SH7770)
392 .long do_IRQ ! 50 0x840
393 .long do_IRQ ! 51 0x860
394 .long do_IRQ ! 52 0x880
395 .long do_IRQ ! 53 0x8a0
396 .long do_IRQ ! 54 0x8c0
397 .long do_IRQ ! 55 0x8e0
398 .long do_IRQ ! 56 0x900
399 .long do_IRQ ! 57 0x920
400 .long do_IRQ ! 58 0x940
401 .long do_IRQ ! 59 0x960
402 .long do_IRQ ! 60 0x980
403 .long do_IRQ ! 61 0x9a0
404 .long do_IRQ ! 62 0x9c0
405 .long do_IRQ ! 63 0x9e0
406 .long do_IRQ ! 64 0xa00
407 .long do_IRQ ! 65 0xa20
408 .long do_IRQ ! 66 0xa4d
409 .long do_IRQ ! 67 0xa60
410 .long do_IRQ ! 68 0xa80
411 .long do_IRQ ! 69 0xaa0
412 .long do_IRQ ! 70 0xac0
413 .long do_IRQ ! 71 0xae0
414 .long do_IRQ ! 72 0xb00
415 .long do_IRQ ! 73 0xb20
416 .long do_IRQ ! 74 0xb40
417 .long do_IRQ ! 75 0xb60
418 .long do_IRQ ! 76 0xb80
419 .long do_IRQ ! 77 0xba0
420 .long do_IRQ ! 78 0xbc0
421 .long do_IRQ ! 79 0xbe0
422 .long do_IRQ ! 80 0xc00
423 .long do_IRQ ! 81 0xc20
424 .long do_IRQ ! 82 0xc40
425 .long do_IRQ ! 83 0xc60
426 .long do_IRQ ! 84 0xc80
427 .long do_IRQ ! 85 0xca0
428 .long do_IRQ ! 86 0xcc0
429 .long do_IRQ ! 87 0xce0
430 .long do_IRQ ! 88 0xd00
431 .long do_IRQ ! 89 0xd20
432 .long do_IRQ ! 90 0xd40
433 .long do_IRQ ! 91 0xd60
434 .long do_IRQ ! 92 0xd80
435 .long do_IRQ ! 93 0xda0
436 .long do_IRQ ! 94 0xdc0
437 .long do_IRQ ! 95 0xde0
438 .long do_IRQ ! 96 0xe00
439 .long do_IRQ ! 97 0xe20
440 .long do_IRQ ! 98 0xe40
441 .long do_IRQ ! 99 0xe60
442 .long do_IRQ ! 100 0xe80
443 .long do_IRQ ! 101 0xea0
444 .long do_IRQ ! 102 0xec0
445 .long do_IRQ ! 103 0xee0
446 .long do_IRQ ! 104 0xf00
447 .long do_IRQ ! 105 0xf20
448 .long do_IRQ ! 106 0xf40
449 .long do_IRQ ! 107 0xf60
450 .long do_IRQ ! 108 0xf80
451#endif
452#else
453 .long exception_error /* 400 */
454 .long exception_error
455 .long exception_error
456 .long exception_error
457 .long do_IRQ ! RTC ati
458 .long do_IRQ ! pri
459 .long do_IRQ ! cui
460 .long exception_error
461 .long exception_error /* 500 */
462 .long exception_error
463 .long exception_error
464 .long do_IRQ ! WDT iti /* 560 */
465 .long do_IRQ ! TMU-ch0
466 .long do_IRQ ! TMU-ch1
467 .long do_IRQ ! TMU-ch2
468 .long do_IRQ ! ticpi2 /* 5E0 */
469 .long do_IRQ ! 32 Hitachi UDI /* 600 */
470 .long exception_error
471 .long do_IRQ ! 34 DMAC dmte0
472 .long do_IRQ ! 35 dmte1
473 .long do_IRQ ! 36 dmte2
474 .long do_IRQ ! 37 dmte3
475 .long do_IRQ ! 38 dmae
476 .long exception_error ! 39 /* 6E0 */
477 .long do_IRQ ! 40 SCIF-ch0 eri /* 700 */
478 .long do_IRQ ! 41 rxi
479 .long do_IRQ ! 42 bri
480 .long do_IRQ ! 43 txi
481 .long do_IRQ ! 44 DMAC dmte4 /* 780 */
482 .long do_IRQ ! 45 dmte5
483 .long do_IRQ ! 46 dmte6
484 .long do_IRQ ! 47 dmte7 /* 7E0 */
485#if defined(CONFIG_SH_FPU)
486 .long do_fpu_state_restore ! 48 /* 800 */
487 .long do_fpu_state_restore ! 49 /* 820 */
488#else
489 .long exception_error
490 .long exception_error
491#endif
492 .long exception_error /* 840 */
493 .long exception_error
494 .long exception_error
495 .long exception_error
496 .long exception_error
497 .long exception_error
498 .long do_IRQ ! 56 CMT /* 900 */
499 .long exception_error
500 .long exception_error
501 .long exception_error
502 .long do_IRQ ! 60 HAC
503 .long exception_error
504 .long exception_error
505 .long exception_error
506 .long do_IRQ ! PCI serr /* A00 */
507 .long do_IRQ ! INTA
508 .long do_IRQ ! INTB
509 .long do_IRQ ! INTC
510 .long do_IRQ ! INTD
511 .long do_IRQ ! err
512 .long do_IRQ ! pwd3
513 .long do_IRQ ! pwd2
514 .long do_IRQ ! pwd1 /* B00 */
515 .long do_IRQ ! pwd0
516 .long exception_error
517 .long exception_error
518 .long do_IRQ ! SCIF-ch1 eri /* B80 */
519 .long do_IRQ ! rxi
520 .long do_IRQ ! bri
521 .long do_IRQ ! txi
522 .long do_IRQ ! SIOF /* C00 */
523 .long exception_error
524 .long exception_error
525 .long exception_error
526 .long do_IRQ ! HSPI /* C80 */
527 .long exception_error
528 .long exception_error
529 .long exception_error
530 .long do_IRQ ! MMCIF fatat /* D00 */
531 .long do_IRQ ! tran
532 .long do_IRQ ! err
533 .long do_IRQ ! frdy
534 .long do_IRQ ! DMAC dmint8 /* D80 */
535 .long do_IRQ ! dmint9
536 .long do_IRQ ! dmint10
537 .long do_IRQ ! dmint11
538 .long do_IRQ ! TMU-ch3 /* E00 */
539 .long do_IRQ ! TMU-ch4
540 .long do_IRQ ! TMU-ch5
541 .long exception_error
542 .long do_IRQ ! SSI
543 .long exception_error
544 .long exception_error
545 .long exception_error
546 .long do_IRQ ! FLCTL flste /* F00 */
547 .long do_IRQ ! fltend
548 .long do_IRQ ! fltrq0
549 .long do_IRQ ! fltrq1
550 .long do_IRQ ! GPIO gpioi0 /* F80 */
551 .long do_IRQ ! gpioi1
552 .long do_IRQ ! gpioi2
553 .long do_IRQ ! gpioi3
554#endif
555
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S
index 97c571fbcdf1..39aaefb2d83f 100644
--- a/arch/sh/kernel/entry.S
+++ b/arch/sh/kernel/entry.S
@@ -1,9 +1,8 @@
1/* $Id: entry.S,v 1.37 2004/06/11 13:02:46 doyu Exp $ 1/*
2 *
3 * linux/arch/sh/entry.S 2 * linux/arch/sh/entry.S
4 * 3 *
5 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 4 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
6 * Copyright (C) 2003 Paul Mundt 5 * Copyright (C) 2003 - 2006 Paul Mundt
7 * 6 *
8 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -78,7 +77,6 @@ OFF_TRA = (16*4+6*4)
78#define k3 r3 77#define k3 r3
79#define k4 r4 78#define k4 r4
80 79
81#define k_ex_code r2_bank /* r2_bank1 */
82#define g_imask r6 /* r6_bank1 */ 80#define g_imask r6 /* r6_bank1 */
83#define k_g_imask r6_bank /* r6_bank1 */ 81#define k_g_imask r6_bank /* r6_bank1 */
84#define current r7 /* r7_bank1 */ 82#define current r7 /* r7_bank1 */
@@ -691,7 +689,7 @@ interrupt:
6910: 6890:
692#endif /* defined(CONFIG_KGDB_NMI) */ 690#endif /* defined(CONFIG_KGDB_NMI) */
693 bra handle_exception 691 bra handle_exception
694 mov.l @k2, k2 692 mov #-1, k2 ! interrupt exception marker
695 693
696 .align 2 694 .align 2
6971: .long EXPEVT 6951: .long EXPEVT
@@ -717,8 +715,7 @@ ENTRY(handle_exception)
717 add current, k1 715 add current, k1
718 mov k1, r15 ! change to kernel stack 716 mov k1, r15 ! change to kernel stack
719 ! 717 !
7201: mov #-1, k4 7181: mov.l 2f, k1
721 mov.l 2f, k1
722 ! 719 !
723#ifdef CONFIG_SH_DSP 720#ifdef CONFIG_SH_DSP
724 mov.l r2, @-r15 ! Save r2, we need another reg 721 mov.l r2, @-r15 ! Save r2, we need another reg
@@ -763,6 +760,8 @@ skip_save:
763#endif 760#endif
764 ! Save the user registers on the stack. 761 ! Save the user registers on the stack.
765 mov.l k2, @-r15 ! EXPEVT 762 mov.l k2, @-r15 ! EXPEVT
763
764 mov #-1, k4
766 mov.l k4, @-r15 ! set TRA (default: -1) 765 mov.l k4, @-r15 ! set TRA (default: -1)
767 ! 766 !
768 sts.l macl, @-r15 767 sts.l macl, @-r15
@@ -797,8 +796,21 @@ skip_save:
797 mov.l r2, @-r15 796 mov.l r2, @-r15
798 mov.l r1, @-r15 797 mov.l r1, @-r15
799 mov.l r0, @-r15 798 mov.l r0, @-r15
800 ! Then, dispatch to the handler, according to the exception code. 799
801 stc k_ex_code, r8 800 /*
801 * This gets a bit tricky.. in the INTEVT case we don't want to use
802 * the VBR offset as a destination in the jump call table, since all
803 * of the destinations are the same. In this case, (interrupt) sets
804 * a marker in r2 (now r2_bank since SR.RB changed), which we check
805 * to determine the exception type. For all other exceptions, we
806 * forcibly read EXPEVT from memory and fix up the jump address, in
807 * the interrupt exception case we jump to do_IRQ() and defer the
808 * INTEVT read until there. As a bonus, we can also clean up the SR.RB
809 * checks that do_IRQ() was doing..
810 */
811 stc r2_bank, r8
812 cmp/pz r8
813 bf interrupt_exception
802 shlr2 r8 814 shlr2 r8
803 shlr r8 815 shlr r8
804 mov.l 4f, r9 816 mov.l 4f, r9
@@ -806,6 +818,8 @@ skip_save:
806 mov.l @r9, r9 818 mov.l @r9, r9
807 jmp @r9 819 jmp @r9
808 nop 820 nop
821 rts
822 nop
809 823
810 .align 2 824 .align 2
8111: .long 0x00001000 ! DSP=1 8251: .long 0x00001000 ! DSP=1
@@ -813,8 +827,17 @@ skip_save:
8133: .long 0xcfffffff ! RB=0, BL=0 8273: .long 0xcfffffff ! RB=0, BL=0
8144: .long exception_handling_table 8284: .long exception_handling_table
815 829
830interrupt_exception:
831 mov.l 1f, r9
832 jmp @r9
833 nop
834 rts
835 nop
836
837 .align 2
8381: .long do_IRQ
839
816 .align 2 840 .align 2
817ENTRY(exception_none) 841ENTRY(exception_none)
818 rts 842 rts
819 nop 843 nop
820
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 3b93682bf18b..acf2602569c4 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -11,6 +11,7 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/kernel_stat.h> 12#include <linux/kernel_stat.h>
13#include <linux/seq_file.h> 13#include <linux/seq_file.h>
14#include <linux/io.h>
14#include <asm/irq.h> 15#include <asm/irq.h>
15#include <asm/processor.h> 16#include <asm/processor.h>
16#include <asm/uaccess.h> 17#include <asm/uaccess.h>
@@ -26,6 +27,7 @@ atomic_t irq_err_count;
26 */ 27 */
27void ack_bad_irq(unsigned int irq) 28void ack_bad_irq(unsigned int irq)
28{ 29{
30 atomic_inc(&irq_err_count);
29 printk("unexpected IRQ trap at vector %02x\n", irq); 31 printk("unexpected IRQ trap at vector %02x\n", irq);
30} 32}
31 33
@@ -85,7 +87,7 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
85 struct pt_regs regs) 87 struct pt_regs regs)
86{ 88{
87 struct pt_regs *old_regs = set_irq_regs(&regs); 89 struct pt_regs *old_regs = set_irq_regs(&regs);
88 int irq = r4; 90 int irq;
89#ifdef CONFIG_4KSTACKS 91#ifdef CONFIG_4KSTACKS
90 union irq_ctx *curctx, *irqctx; 92 union irq_ctx *curctx, *irqctx;
91#endif 93#endif
@@ -109,20 +111,9 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
109#endif 111#endif
110 112
111#ifdef CONFIG_CPU_HAS_INTEVT 113#ifdef CONFIG_CPU_HAS_INTEVT
112 __asm__ __volatile__ ( 114 irq = (ctrl_inl(INTEVT) >> 5) - 16;
113#ifdef CONFIG_CPU_HAS_SR_RB
114 "stc r2_bank, %0\n\t"
115#else 115#else
116 "mov.l @%1, %0\n\t" 116 irq = r4;
117#endif
118 "shlr2 %0\n\t"
119 "shlr2 %0\n\t"
120 "shlr %0\n\t"
121 "add #-16, %0\n\t"
122 : "=z" (irq), "=r" (r4)
123 : "1" (INTEVT)
124 : "memory"
125 );
126#endif 117#endif
127 118
128 irq = irq_demux(irq); 119 irq = irq_demux(irq);
@@ -147,9 +138,9 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
147 __asm__ __volatile__ ( 138 __asm__ __volatile__ (
148 "mov %0, r4 \n" 139 "mov %0, r4 \n"
149 "mov r15, r9 \n" 140 "mov r15, r9 \n"
150 "jsr @%2 \n" 141 "jsr @%1 \n"
151 /* swith to the irq stack */ 142 /* swith to the irq stack */
152 " mov %3, r15 \n" 143 " mov %2, r15 \n"
153 /* restore the stack (ring zero) */ 144 /* restore the stack (ring zero) */
154 "mov r9, r15 \n" 145 "mov r9, r15 \n"
155 : /* no outputs */ 146 : /* no outputs */