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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [armnommu/] [lib/] [irqs-acorn.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 * linux/arch/arm/lib/irqs.S
3
 *
4
 * Copyright (C) 1995, 1996 Russell King. (rmk@ecs.soton.ac.uk)
5
 *
6
 * Interrupt wrappers - handles disabling & re-enabling interrupts
7
 *
8
 * Changes:
9
 *  09/02/1996  RMK     Stream-lined normal interrupt wrapper - now uses 78
10
 *                      cycles instead of 85 and 3 less instructions.
11
 *  08/09/1996  RMK     Changed spec - now does not allow for disable & enable
12
 *                      of the executing interrupt.
13
 *                      IRQ13 is special - it always is entered with IRQs disabled.
14
 *                      IRQ14 & 15 are special - the IRQ is disabled in IOC
15
 *                       but interrupts are enabled.  It is expected that the
16
 *                       interrupt routine will re-enable the relevent IRQ...
17
 */
18
 
19
#include 
20
 
21
@ IRQ stubs
22
 
23
@ IRQ stubs entered with:
24
@ r1 = IOC
25
@ r2 = IRQ number
26
@ return 0 for normal irq
27
 
28
                .text
29
#define BAD_IRQ(n, msk, reg)                            \
30
                .global _bad_IRQ##n##_interrupt         ;\
31
_bad_IRQ##n##_interrupt:                                ;\
32
                stmfd   sp!, {lr}                       ;\
33
                ldrb    r0, [r4, $reg]                  ;\
34
                bic     r0, r0, $msk                    ;\
35
                strb    r0, [r4, $reg]                  ;\
36
                bl      _bad_IRQ                        ;\
37
                mov     r0, $1                          ;\
38
                LOADREGS(fd, sp!, {pc})
39
 
40
BAD_IRQ( 0, 0x01, 0x18)
41
BAD_IRQ( 1, 0x02, 0x18)
42
BAD_IRQ( 2, 0x04, 0x18)
43
BAD_IRQ( 3, 0x08, 0x18)
44
BAD_IRQ( 4, 0x10, 0x18)
45
BAD_IRQ( 5, 0x20, 0x18)
46
BAD_IRQ( 6, 0x40, 0x18)
47
BAD_IRQ( 7, 0x80, 0x18)
48
BAD_IRQ( 8, 0x01, 0x28)
49
BAD_IRQ( 9, 0x02, 0x28)
50
BAD_IRQ(10, 0x04, 0x28)
51
BAD_IRQ(11, 0x08, 0x28)
52
BAD_IRQ(12, 0x10, 0x28)
53
BAD_IRQ(13, 0x20, 0x28)
54
BAD_IRQ(14, 0x40, 0x28)
55
BAD_IRQ(15, 0x80, 0x28)
56
BAD_IRQ(16, 0x01, 0x1f8)
57
BAD_IRQ(17, 0x02, 0x1f8)
58
BAD_IRQ(18, 0x04, 0x1f8)
59
BAD_IRQ(19, 0x08, 0x1f8)
60
BAD_IRQ(20, 0x10, 0x1f8)
61
BAD_IRQ(21, 0x20, 0x1f8)
62
BAD_IRQ(22, 0x40, 0x1f8)
63
BAD_IRQ(23, 0x80, 0x1f8)
64
 
65
#define FAST_IRQ8(n)                                    \
66
                .globl  _fast_IRQ##n##_interrupt        ;\
67
_fast_IRQ##n##_interrupt:                               ;\
68
                mov     r9, lr                          ;\
69
                ldrb    r2, [r4, $0x18]                 ;\
70
                bic     r2, r2, $1 << n                 ;\
71
                strb    r2, [r4, $0x18]                 ;\
72
                mov     r6, $1 << n                     ;\
73
                strb    r6, [r4, $0x14]                 ;\
74
                ldr     r5, LC1                         ;\
75
                ldr     r7, [r5]                        ;\
76
                add     r2, r7, $1                      ;\
77
                str     r2, [r5]                        ;\
78
                bl      _do_fast_IRQ                    ;\
79
                DISABLEIRQS(r0)                         ;\
80
                str     r7, [r5]                        ;\
81
                ldrb    r0, [r4, $0x18]                 ;\
82
                orr     r0, r0, $1 << n                 ;\
83
                strb    r0, [r4, $0x18]                 ;\
84
                mov     r0, $1                          ;\
85
                RETINSTR(mov,pc,r9)
86
 
87
#define FAST_IRQ16(n)                                   \
88
                .globl  _fast_IRQ##n##_interrupt        ;\
89
_fast_IRQ##n##_interrupt:                               ;\
90
                mov     r9, lr                          ;\
91
                ldrb    r2, [r4, $0x28]                 ;\
92
                bic     r2, r2, $1 << (n - 8)           ;\
93
                strb    r2, [r4, $0x28]                 ;\
94
                ldr     r5, LC1                         ;\
95
                ldr     r7, [r5]                        ;\
96
                add     r2, r7, $1                      ;\
97
                str     r2, [r5]                        ;\
98
                bl      _do_fast_IRQ                    ;\
99
                DISABLEIRQS(r0)                         ;\
100
                str     r7, [r5]                        ;\
101
                ldrb    r0, [r4, $0x28]                 ;\
102
                orr     r0, r0, $1 << (n - 8)           ;\
103
                strb    r0, [r4, $0x28]                 ;\
104
                mov     r0, $1                          ;\
105
                RETINSTR(mov,pc,r9)
106
 
107
#define FAST_IRQ24(n)                                   \
108
                .globl  _fast_IRQ##n##_interrupt        ;\
109
_fast_IRQ##n##_interrupt:                               ;\
110
                mov     r9, lr                          ;\
111
                ldrb    r2, [r4, $0x1f8]                ;\
112
                bic     r2, r2, $1 << (n - 16)          ;\
113
                strb    r2, [r4, $0x1f8]                ;\
114
                ldr     r5, LC1                         ;\
115
                ldr     r7, [r5]                        ;\
116
                add     r2, r7, $1                      ;\
117
                str     r2, [r5]                        ;\
118
                bl      _do_fast_IRQ                    ;\
119
                DISABLEIRQS(r0)                         ;\
120
                str     r7, [r5]                        ;\
121
                ldrb    r0, [r4, $0x1f8]                ;\
122
                orr     r0, r0, $1 << (n - 16)          ;\
123
                strb    r0, [r4, $0x1f8]                ;\
124
                mov     r0, $1                          ;\
125
                RETINSTR(mov,pc,r9)
126
 
127
FAST_IRQ8 ( 0)
128
FAST_IRQ8 ( 1)
129
FAST_IRQ8 ( 2)
130
FAST_IRQ8 ( 3)
131
FAST_IRQ8 ( 4)
132
FAST_IRQ8 ( 5)
133
FAST_IRQ8 ( 6)
134
FAST_IRQ8 ( 7)
135
FAST_IRQ16( 8)
136
FAST_IRQ16( 9)
137
FAST_IRQ16(10)
138
FAST_IRQ16(11)
139
FAST_IRQ16(12)
140
 
141
LC1:            .word   _intr_count
142
 
143
                .globl  _fast_IRQ13_interrupt
144
_fast_IRQ13_interrupt:
145
                mov     r9, lr
146
                ldr     r5, LC1
147
                ldr     r7, [r5]
148
                add     r2, r7, #1
149
                str     r2, [r5]
150
                bl      _do_fast_IRQ
151
                str     r7, [r5]
152
                mov     r0, #1
153
                RETINSTR(mov,pc,r9)
154
 
155
                .globl  _fast_IRQ14_interrupt
156
_fast_IRQ14_interrupt:
157
                mov     r9, lr
158
                ldrb    r2, [r4, #0x28]
159
                bic     r2, r2, #1 << 6
160
                strb    r2, [r4, #0x28]
161
                ldr     r5, LC1
162
                ldr     r7, [r5]
163
                add     r2, r7, #1
164
                str     r2, [r5]
165
                bl      _do_fast_IRQ
166
                str     r7, [r5]
167
                mov     r0, #1
168
                RETINSTR(mov,pc,r9)
169
 
170
FAST_IRQ16(15)
171
FAST_IRQ24(16)
172
FAST_IRQ24(17)
173
FAST_IRQ24(18)
174
FAST_IRQ24(19)
175
FAST_IRQ24(20)
176
FAST_IRQ24(21)
177
FAST_IRQ24(22)
178
FAST_IRQ24(23)
179
 
180
#define NORM_IRQ8(n)                                    \
181
                .global _IRQ##n##_interrupt             ;\
182
_IRQ##n##_interrupt:                                    ;\
183
                mov     r9, lr                          ;\
184
                ldrb    r2, [r4, $0x18]                 ;\
185
                bic     r2, r2, $1 << n                 ;\
186
                strb    r2, [r4, $0x18]                 ;\
187
                mov     r6, $1 << n                     ;\
188
                strb    r6, [r4, $0x14]                 ;\
189
                ldr     r5, LC2                         ;\
190
                ldr     r7, [r5]                        ;\
191
                add     r2, r7, $1                      ;\
192
                str     r2, [r5]                        ;\
193
                ENABLEIRQS(r2)                          ;\
194
                bl      _do_IRQ                         ;\
195
                DISABLEIRQS(r0)                         ;\
196
                str     r7, [r5]                        ;\
197
                ldrb    r0, [r4, $0x18]                 ;\
198
                orr     r0, r0, $1 << n                 ;\
199
                strb    r0, [r4, $0x18]                 ;\
200
                mov     r0, $0                          ;\
201
                RETINSTR(mov,pc,r9)
202
 
203
#define NORM_IRQ16(n)                                   \
204
                .global _IRQ##n##_interrupt             ;\
205
_IRQ##n##_interrupt:                                    ;\
206
                mov     r9, lr                          ;\
207
                ldrb    r2, [r4, $0x28]                 ;\
208
                bic     r2, r2, $1 << (n - 8)           ;\
209
                strb    r2, [r4, $0x28]                 ;\
210
                ldr     r5, LC2                         ;\
211
                ldr     r7, [r5]                        ;\
212
                add     r2, r7, $1                      ;\
213
                str     r2, [r5]                        ;\
214
                ENABLEIRQS(r2)                          ;\
215
                bl      _do_IRQ                         ;\
216
                DISABLEIRQS(r2)                         ;\
217
                str     r7, [r5]                        ;\
218
                ldrb    r0, [r4, $0x28]                 ;\
219
                orr     r0, r0, $1 << (n - 8)           ;\
220
                strb    r0, [r4, $0x28]                 ;\
221
                mov     r0, $0                          ;\
222
                RETINSTR(mov,pc,r9)
223
 
224
#define NORM_IRQ24(n)                                   \
225
                .globl  _IRQ##n##_interrupt             ;\
226
_IRQ##n##_interrupt:                                    ;\
227
                mov     r9, lr                          ;\
228
                ldrb    r2, [r4, $0x1f8]                ;\
229
                bic     r2, r2, $1 << (n - 16)          ;\
230
                strb    r2, [r4, $0x1f8]                ;\
231
                ldr     r5, LC2                         ;\
232
                ldr     r7, [r5]                        ;\
233
                add     r2, r7, $1                      ;\
234
                str     r2, [r5]                        ;\
235
                ENABLEIRQS(r2)                          ;\
236
                bl      _do_IRQ                         ;\
237
                DISABLEIRQS(r2)                         ;\
238
                str     r7, [r5]                        ;\
239
                ldrb    r0, [r4, $0x1f8]                ;\
240
                orr     r0, r0, $1 << (n - 16)          ;\
241
                strb    r0, [r4, $0x1f8]                ;\
242
                mov     r0, $0                          ;\
243
                RETINSTR(mov,pc,r9)
244
 
245
NORM_IRQ8 ( 0)
246
NORM_IRQ8 ( 1)
247
NORM_IRQ8 ( 2)
248
NORM_IRQ8 ( 3)
249
NORM_IRQ8 ( 4)
250
 
251
                .globl  _timer_IRQ_interrupt
252
_timer_IRQ_interrupt:
253
                mov     r9, lr
254
                ldrb    r2, [r4, #0x18]
255
                bic     r2, r2, #1 << 5
256
                strb    r2, [r4, #0x18]
257
                mov     r2, #1 << 5
258
                strb    r2, [r4, #0x14]
259
                ldr     r5, LC1
260
                ldr     r7, [r5]
261
                add     r2, r7, #1
262
                str     r2, [r5]
263
                bl      _do_IRQ
264
                str     r7, [r5]
265
                ldrb    r2, [r4, #0x18]
266
                orr     r2, r2, #1 << 5
267
                strb    r2, [r4, #0x18]
268
                mov     r0, #0
269
                RETINSTR(mov,pc,r9)
270
 
271
NORM_IRQ8 ( 6)
272
NORM_IRQ8 ( 7)
273
NORM_IRQ16( 8)
274
NORM_IRQ16( 9)
275
NORM_IRQ16(10)
276
NORM_IRQ16(11)
277
NORM_IRQ16(12)
278
 
279
LC2:            .word   _intr_count
280
 
281
                .globl  _IRQ13_interrupt
282
_IRQ13_interrupt:
283
                mov     r9, lr
284
                ldr     r5, LC2
285
                ldr     r7, [r5]
286
                add     r2, r7, #1
287
                str     r2, [r5]
288
                bl      _do_IRQ
289
                str     r7, [r5]
290
                mov     r0, #0
291
                RETINSTR(mov,pc,r9)
292
 
293
                .globl  _IRQ14_interrupt
294
_IRQ14_interrupt:
295
                mov     r9, lr
296
                ldrb    r2, [r4, #0x28]
297
                bic     r2, r2, #1 << 6
298
                strb    r2, [r4, #0x28]
299
                ldr     r5, LC2
300
                ldr     r7, [r5]
301
                add     r2, r7, #1
302
                str     r2, [r5]
303
                bl      _do_IRQ
304
                str     r7, [r5]
305
                mov     r0, #0
306
                RETINSTR(mov,pc,r9)
307
 
308
NORM_IRQ16(15)
309
NORM_IRQ24(16)
310
NORM_IRQ24(17)
311
NORM_IRQ24(18)
312
NORM_IRQ24(19)
313
NORM_IRQ24(20)
314
NORM_IRQ24(21)
315
NORM_IRQ24(22)
316
NORM_IRQ24(23)
317
 
318
#define PROBE_IRQ8(n, v1)                               \
319
                .global _probe_IRQ##n##_interrupt       ;\
320
_probe_IRQ##n##_interrupt:                              ;\
321
                ldrb    r0, [r4, $0x18]                 ;\
322
                bic     r0, r0, $ v1                    ;\
323
                strb    r0, [r4, $0x18]                 ;\
324
                mov     r0, $ v1                        ;\
325
                strb    r0, [r4, $0x14]                 ;\
326
                mov     r0, $1                          ;\
327
                RETINSTR(mov,pc,lr)
328
 
329
#define PROBE_IRQ16(n, v1)                              \
330
                .global _probe_IRQ##n##_interrupt       ;\
331
_probe_IRQ##n##_interrupt:                              ;\
332
                ldrb    r0, [r4, $0x28]                 ;\
333
                bic     r0, r0, $ v1                    ;\
334
                strb    r0, [r4, $0x28]                 ;\
335
                mov     r0, $1                          ;\
336
                RETINSTR(mov,pc,lr)
337
 
338
#define PROBE_IRQ24(n, v1)                              \
339
                .global _probe_IRQ##n##_interrupt       ;\
340
_probe_IRQ##n##_interrupt:                              ;\
341
                ldrb    r0, [r4, $0x1f8]                ;\
342
                bic     r0, r0, $ v1                    ;\
343
                strb    r0, [r4, $0x1f8]                ;\
344
                mov     r0, $1                          ;\
345
                RETINSTR(mov,pc,lr)
346
 
347
PROBE_IRQ8 ( 0,   1)
348
PROBE_IRQ8 ( 1,   2)
349
PROBE_IRQ8 ( 2,   4)
350
PROBE_IRQ8 ( 3,   8)
351
PROBE_IRQ8 ( 4,  16)
352
PROBE_IRQ8 ( 5,  32)
353
PROBE_IRQ8 ( 6,  64)
354
PROBE_IRQ8 ( 7, 128)
355
PROBE_IRQ16( 8,   1)
356
PROBE_IRQ16( 9,   2)
357
PROBE_IRQ16(10,   4)
358
PROBE_IRQ16(11,   8)
359
PROBE_IRQ16(12,  16)
360
PROBE_IRQ16(13,  32)
361
PROBE_IRQ16(14,  64)
362
PROBE_IRQ16(15, 128)
363
PROBE_IRQ24(16,   1)
364
PROBE_IRQ24(17,   2)
365
PROBE_IRQ24(18,   4)
366
PROBE_IRQ24(19,   8)
367
PROBE_IRQ24(20,  16)
368
PROBE_IRQ24(21,  32)
369
PROBE_IRQ24(22,  64)
370
PROBE_IRQ24(23, 128)
371
 
372
                .global _bad_IRQ
373
_bad_IRQ:       adr     r0, Lmsg
374
                mov     r1, r2
375
                b       _printk
376
 
377
Lmsg:           .ascii  "Bad interrupt %d received!\n\0"
378
                .align

powered by: WebSVN 2.1.0

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