diff options
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/irq_32.c | 229 |
1 files changed, 92 insertions, 137 deletions
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index 85db35d894fc..974dab046a04 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sparc/kernel/irq.c: Interrupt request handling routines. On the | 2 | * Interrupt request handling routines. On the |
3 | * Sparc the IRQs are basically 'cast in stone' | 3 | * Sparc the IRQs are basically 'cast in stone' |
4 | * and you are supposed to probe the prom's device | 4 | * and you are supposed to probe the prom's device |
5 | * node trees to find out who's got which IRQ. | 5 | * node trees to find out who's got which IRQ. |
6 | * | 6 | * |
7 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | 7 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
8 | * Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx) | 8 | * Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx) |
@@ -11,40 +11,10 @@ | |||
11 | * Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org) | 11 | * Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org) |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/sched.h> | ||
16 | #include <linux/ptrace.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/linkage.h> | ||
19 | #include <linux/kernel_stat.h> | 14 | #include <linux/kernel_stat.h> |
20 | #include <linux/signal.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/slab.h> | ||
23 | #include <linux/random.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/smp.h> | ||
26 | #include <linux/delay.h> | ||
27 | #include <linux/threads.h> | ||
28 | #include <linux/spinlock.h> | ||
29 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
30 | 16 | ||
31 | #include <asm/ptrace.h> | ||
32 | #include <asm/processor.h> | ||
33 | #include <asm/system.h> | ||
34 | #include <asm/psr.h> | ||
35 | #include <asm/smp.h> | ||
36 | #include <asm/vaddrs.h> | ||
37 | #include <asm/timer.h> | ||
38 | #include <asm/openprom.h> | ||
39 | #include <asm/oplib.h> | ||
40 | #include <asm/traps.h> | ||
41 | #include <asm/irq.h> | ||
42 | #include <asm/io.h> | ||
43 | #include <asm/pgalloc.h> | ||
44 | #include <asm/pgtable.h> | ||
45 | #include <asm/pcic.h> | 17 | #include <asm/pcic.h> |
46 | #include <asm/cacheflush.h> | ||
47 | #include <asm/irq_regs.h> | ||
48 | #include <asm/leon.h> | 18 | #include <asm/leon.h> |
49 | 19 | ||
50 | #include "kernel.h" | 20 | #include "kernel.h" |
@@ -57,6 +27,7 @@ | |||
57 | #define SMP_NOP2 | 27 | #define SMP_NOP2 |
58 | #define SMP_NOP3 | 28 | #define SMP_NOP3 |
59 | #endif /* SMP */ | 29 | #endif /* SMP */ |
30 | |||
60 | unsigned long arch_local_irq_save(void) | 31 | unsigned long arch_local_irq_save(void) |
61 | { | 32 | { |
62 | unsigned long retval; | 33 | unsigned long retval; |
@@ -135,8 +106,7 @@ static void irq_panic(void) | |||
135 | prom_halt(); | 106 | prom_halt(); |
136 | } | 107 | } |
137 | 108 | ||
138 | void (*sparc_init_timers)(irq_handler_t ) = | 109 | void (*sparc_init_timers)(irq_handler_t) = (void (*)(irq_handler_t))irq_panic; |
139 | (void (*)(irq_handler_t )) irq_panic; | ||
140 | 110 | ||
141 | /* | 111 | /* |
142 | * Dave Redman (djhr@tadpole.co.uk) | 112 | * Dave Redman (djhr@tadpole.co.uk) |
@@ -145,7 +115,7 @@ void (*sparc_init_timers)(irq_handler_t ) = | |||
145 | * instead, because some of the devices attach very early, I do something | 115 | * instead, because some of the devices attach very early, I do something |
146 | * equally sucky but at least we'll never try to free statically allocated | 116 | * equally sucky but at least we'll never try to free statically allocated |
147 | * space or call kmalloc before kmalloc_init :(. | 117 | * space or call kmalloc before kmalloc_init :(. |
148 | * | 118 | * |
149 | * In fact it's the timer10 that attaches first.. then timer14 | 119 | * In fact it's the timer10 that attaches first.. then timer14 |
150 | * then kmalloc_init is called.. then the tty interrupts attach. | 120 | * then kmalloc_init is called.. then the tty interrupts attach. |
151 | * hmmm.... | 121 | * hmmm.... |
@@ -166,22 +136,20 @@ DEFINE_SPINLOCK(irq_action_lock); | |||
166 | 136 | ||
167 | int show_interrupts(struct seq_file *p, void *v) | 137 | int show_interrupts(struct seq_file *p, void *v) |
168 | { | 138 | { |
169 | int i = *(loff_t *) v; | 139 | int i = *(loff_t *)v; |
170 | struct irqaction * action; | 140 | struct irqaction *action; |
171 | unsigned long flags; | 141 | unsigned long flags; |
172 | #ifdef CONFIG_SMP | 142 | #ifdef CONFIG_SMP |
173 | int j; | 143 | int j; |
174 | #endif | 144 | #endif |
175 | 145 | ||
176 | if (sparc_cpu_model == sun4d) { | 146 | if (sparc_cpu_model == sun4d) |
177 | extern int show_sun4d_interrupts(struct seq_file *, void *); | ||
178 | |||
179 | return show_sun4d_interrupts(p, v); | 147 | return show_sun4d_interrupts(p, v); |
180 | } | 148 | |
181 | spin_lock_irqsave(&irq_action_lock, flags); | 149 | spin_lock_irqsave(&irq_action_lock, flags); |
182 | if (i < NR_IRQS) { | 150 | if (i < NR_IRQS) { |
183 | action = sparc_irq[i].action; | 151 | action = sparc_irq[i].action; |
184 | if (!action) | 152 | if (!action) |
185 | goto out_unlock; | 153 | goto out_unlock; |
186 | seq_printf(p, "%3d: ", i); | 154 | seq_printf(p, "%3d: ", i); |
187 | #ifndef CONFIG_SMP | 155 | #ifndef CONFIG_SMP |
@@ -195,7 +163,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
195 | seq_printf(p, " %c %s", | 163 | seq_printf(p, " %c %s", |
196 | (action->flags & IRQF_DISABLED) ? '+' : ' ', | 164 | (action->flags & IRQF_DISABLED) ? '+' : ' ', |
197 | action->name); | 165 | action->name); |
198 | for (action=action->next; action; action = action->next) { | 166 | for (action = action->next; action; action = action->next) { |
199 | seq_printf(p, ",%s %s", | 167 | seq_printf(p, ",%s %s", |
200 | (action->flags & IRQF_DISABLED) ? " +" : "", | 168 | (action->flags & IRQF_DISABLED) ? " +" : "", |
201 | action->name); | 169 | action->name); |
@@ -209,22 +177,20 @@ out_unlock: | |||
209 | 177 | ||
210 | void free_irq(unsigned int irq, void *dev_id) | 178 | void free_irq(unsigned int irq, void *dev_id) |
211 | { | 179 | { |
212 | struct irqaction * action; | 180 | struct irqaction *action; |
213 | struct irqaction **actionp; | 181 | struct irqaction **actionp; |
214 | unsigned long flags; | 182 | unsigned long flags; |
215 | unsigned int cpu_irq; | 183 | unsigned int cpu_irq; |
216 | 184 | ||
217 | if (sparc_cpu_model == sun4d) { | 185 | if (sparc_cpu_model == sun4d) { |
218 | extern void sun4d_free_irq(unsigned int, void *); | ||
219 | |||
220 | sun4d_free_irq(irq, dev_id); | 186 | sun4d_free_irq(irq, dev_id); |
221 | return; | 187 | return; |
222 | } | 188 | } |
223 | cpu_irq = irq & (NR_IRQS - 1); | 189 | cpu_irq = irq & (NR_IRQS - 1); |
224 | if (cpu_irq > 14) { /* 14 irq levels on the sparc */ | 190 | if (cpu_irq > 14) { /* 14 irq levels on the sparc */ |
225 | printk("Trying to free bogus IRQ %d\n", irq); | 191 | printk(KERN_ERR "Trying to free bogus IRQ %d\n", irq); |
226 | return; | 192 | return; |
227 | } | 193 | } |
228 | 194 | ||
229 | spin_lock_irqsave(&irq_action_lock, flags); | 195 | spin_lock_irqsave(&irq_action_lock, flags); |
230 | 196 | ||
@@ -232,7 +198,7 @@ void free_irq(unsigned int irq, void *dev_id) | |||
232 | action = *actionp; | 198 | action = *actionp; |
233 | 199 | ||
234 | if (!action->handler) { | 200 | if (!action->handler) { |
235 | printk("Trying to free free IRQ%d\n",irq); | 201 | printk(KERN_ERR "Trying to free free IRQ%d\n", irq); |
236 | goto out_unlock; | 202 | goto out_unlock; |
237 | } | 203 | } |
238 | if (dev_id) { | 204 | if (dev_id) { |
@@ -242,19 +208,21 @@ void free_irq(unsigned int irq, void *dev_id) | |||
242 | actionp = &action->next; | 208 | actionp = &action->next; |
243 | } | 209 | } |
244 | if (!action) { | 210 | if (!action) { |
245 | printk("Trying to free free shared IRQ%d\n",irq); | 211 | printk(KERN_ERR "Trying to free free shared IRQ%d\n", |
212 | irq); | ||
246 | goto out_unlock; | 213 | goto out_unlock; |
247 | } | 214 | } |
248 | } else if (action->flags & IRQF_SHARED) { | 215 | } else if (action->flags & IRQF_SHARED) { |
249 | printk("Trying to free shared IRQ%d with NULL device ID\n", irq); | 216 | printk(KERN_ERR "Trying to free shared IRQ%d with NULL device ID\n", |
217 | irq); | ||
250 | goto out_unlock; | 218 | goto out_unlock; |
251 | } | 219 | } |
252 | if (action->flags & SA_STATIC_ALLOC) | 220 | if (action->flags & SA_STATIC_ALLOC) { |
253 | { | 221 | /* |
254 | /* This interrupt is marked as specially allocated | 222 | * This interrupt is marked as specially allocated |
255 | * so it is a bad idea to free it. | 223 | * so it is a bad idea to free it. |
256 | */ | 224 | */ |
257 | printk("Attempt to free statically allocated IRQ%d (%s)\n", | 225 | printk(KERN_ERR "Attempt to free statically allocated IRQ%d (%s)\n", |
258 | irq, action->name); | 226 | irq, action->name); |
259 | goto out_unlock; | 227 | goto out_unlock; |
260 | } | 228 | } |
@@ -275,7 +243,6 @@ void free_irq(unsigned int irq, void *dev_id) | |||
275 | out_unlock: | 243 | out_unlock: |
276 | spin_unlock_irqrestore(&irq_action_lock, flags); | 244 | spin_unlock_irqrestore(&irq_action_lock, flags); |
277 | } | 245 | } |
278 | |||
279 | EXPORT_SYMBOL(free_irq); | 246 | EXPORT_SYMBOL(free_irq); |
280 | 247 | ||
281 | /* | 248 | /* |
@@ -297,44 +264,41 @@ void synchronize_irq(unsigned int irq) | |||
297 | EXPORT_SYMBOL(synchronize_irq); | 264 | EXPORT_SYMBOL(synchronize_irq); |
298 | #endif /* SMP */ | 265 | #endif /* SMP */ |
299 | 266 | ||
300 | void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs) | 267 | void unexpected_irq(int irq, void *dev_id, struct pt_regs *regs) |
301 | { | 268 | { |
302 | int i; | 269 | int i; |
303 | struct irqaction * action; | 270 | struct irqaction *action; |
304 | unsigned int cpu_irq; | 271 | unsigned int cpu_irq; |
305 | 272 | ||
306 | cpu_irq = irq & (NR_IRQS - 1); | 273 | cpu_irq = irq & (NR_IRQS - 1); |
307 | action = sparc_irq[cpu_irq].action; | 274 | action = sparc_irq[cpu_irq].action; |
308 | 275 | ||
309 | printk("IO device interrupt, irq = %d\n", irq); | 276 | printk(KERN_ERR "IO device interrupt, irq = %d\n", irq); |
310 | printk("PC = %08lx NPC = %08lx FP=%08lx\n", regs->pc, | 277 | printk(KERN_ERR "PC = %08lx NPC = %08lx FP=%08lx\n", regs->pc, |
311 | regs->npc, regs->u_regs[14]); | 278 | regs->npc, regs->u_regs[14]); |
312 | if (action) { | 279 | if (action) { |
313 | printk("Expecting: "); | 280 | printk(KERN_ERR "Expecting: "); |
314 | for (i = 0; i < 16; i++) | 281 | for (i = 0; i < 16; i++) |
315 | if (action->handler) | 282 | if (action->handler) |
316 | printk("[%s:%d:0x%x] ", action->name, | 283 | printk(KERN_CONT "[%s:%d:0x%x] ", action->name, |
317 | (int) i, (unsigned int) action->handler); | 284 | i, (unsigned int)action->handler); |
318 | } | 285 | } |
319 | printk("AIEEE\n"); | 286 | printk(KERN_ERR "AIEEE\n"); |
320 | panic("bogus interrupt received"); | 287 | panic("bogus interrupt received"); |
321 | } | 288 | } |
322 | 289 | ||
323 | void handler_irq(int pil, struct pt_regs * regs) | 290 | void handler_irq(int pil, struct pt_regs *regs) |
324 | { | 291 | { |
325 | struct pt_regs *old_regs; | 292 | struct pt_regs *old_regs; |
326 | struct irqaction * action; | 293 | struct irqaction *action; |
327 | int cpu = smp_processor_id(); | 294 | int cpu = smp_processor_id(); |
328 | #ifdef CONFIG_SMP | ||
329 | extern void smp4m_irq_rotate(int cpu); | ||
330 | #endif | ||
331 | 295 | ||
332 | old_regs = set_irq_regs(regs); | 296 | old_regs = set_irq_regs(regs); |
333 | irq_enter(); | 297 | irq_enter(); |
334 | disable_pil_irq(pil); | 298 | disable_pil_irq(pil); |
335 | #ifdef CONFIG_SMP | 299 | #ifdef CONFIG_SMP |
336 | /* Only rotate on lower priority IRQs (scsi, ethernet, etc.). */ | 300 | /* Only rotate on lower priority IRQs (scsi, ethernet, etc.). */ |
337 | if((sparc_cpu_model==sun4m) && (pil < 10)) | 301 | if ((sparc_cpu_model==sun4m) && (pil < 10)) |
338 | smp4m_irq_rotate(cpu); | 302 | smp4m_irq_rotate(cpu); |
339 | #endif | 303 | #endif |
340 | action = sparc_irq[pil].action; | 304 | action = sparc_irq[pil].action; |
@@ -354,7 +318,8 @@ void handler_irq(int pil, struct pt_regs * regs) | |||
354 | 318 | ||
355 | #if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE) | 319 | #if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE) |
356 | 320 | ||
357 | /* Fast IRQs on the Sparc can only have one routine attached to them, | 321 | /* |
322 | * Fast IRQs on the Sparc can only have one routine attached to them, | ||
358 | * thus no sharing possible. | 323 | * thus no sharing possible. |
359 | */ | 324 | */ |
360 | static int request_fast_irq(unsigned int irq, | 325 | static int request_fast_irq(unsigned int irq, |
@@ -367,15 +332,13 @@ static int request_fast_irq(unsigned int irq, | |||
367 | int ret; | 332 | int ret; |
368 | #if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON | 333 | #if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON |
369 | struct tt_entry *trap_table; | 334 | struct tt_entry *trap_table; |
370 | extern struct tt_entry trapbase_cpu1, trapbase_cpu2, trapbase_cpu3; | ||
371 | #endif | 335 | #endif |
372 | |||
373 | cpu_irq = irq & (NR_IRQS - 1); | 336 | cpu_irq = irq & (NR_IRQS - 1); |
374 | if(cpu_irq > 14) { | 337 | if (cpu_irq > 14) { |
375 | ret = -EINVAL; | 338 | ret = -EINVAL; |
376 | goto out; | 339 | goto out; |
377 | } | 340 | } |
378 | if(!handler) { | 341 | if (!handler) { |
379 | ret = -EINVAL; | 342 | ret = -EINVAL; |
380 | goto out; | 343 | goto out; |
381 | } | 344 | } |
@@ -383,34 +346,33 @@ static int request_fast_irq(unsigned int irq, | |||
383 | spin_lock_irqsave(&irq_action_lock, flags); | 346 | spin_lock_irqsave(&irq_action_lock, flags); |
384 | 347 | ||
385 | action = sparc_irq[cpu_irq].action; | 348 | action = sparc_irq[cpu_irq].action; |
386 | if(action) { | 349 | if (action) { |
387 | if(action->flags & IRQF_SHARED) | 350 | if (action->flags & IRQF_SHARED) |
388 | panic("Trying to register fast irq when already shared.\n"); | 351 | panic("Trying to register fast irq when already shared.\n"); |
389 | if(irqflags & IRQF_SHARED) | 352 | if (irqflags & IRQF_SHARED) |
390 | panic("Trying to register fast irq as shared.\n"); | 353 | panic("Trying to register fast irq as shared.\n"); |
391 | 354 | ||
392 | /* Anyway, someone already owns it so cannot be made fast. */ | 355 | /* Anyway, someone already owns it so cannot be made fast. */ |
393 | printk("request_fast_irq: Trying to register yet already owned.\n"); | 356 | printk(KERN_ERR "request_fast_irq: Trying to register yet already owned.\n"); |
394 | ret = -EBUSY; | 357 | ret = -EBUSY; |
395 | goto out_unlock; | 358 | goto out_unlock; |
396 | } | 359 | } |
397 | 360 | ||
398 | /* If this is flagged as statically allocated then we use our | 361 | /* |
362 | * If this is flagged as statically allocated then we use our | ||
399 | * private struct which is never freed. | 363 | * private struct which is never freed. |
400 | */ | 364 | */ |
401 | if (irqflags & SA_STATIC_ALLOC) { | 365 | if (irqflags & SA_STATIC_ALLOC) { |
402 | if (static_irq_count < MAX_STATIC_ALLOC) | 366 | if (static_irq_count < MAX_STATIC_ALLOC) |
403 | action = &static_irqaction[static_irq_count++]; | 367 | action = &static_irqaction[static_irq_count++]; |
404 | else | 368 | else |
405 | printk("Fast IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n", | 369 | printk(KERN_ERR "Fast IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n", |
406 | irq, devname); | 370 | irq, devname); |
407 | } | 371 | } |
408 | 372 | ||
409 | if (action == NULL) | 373 | if (action == NULL) |
410 | action = kmalloc(sizeof(struct irqaction), | 374 | action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC); |
411 | GFP_ATOMIC); | 375 | if (!action) { |
412 | |||
413 | if (!action) { | ||
414 | ret = -ENOMEM; | 376 | ret = -ENOMEM; |
415 | goto out_unlock; | 377 | goto out_unlock; |
416 | } | 378 | } |
@@ -426,9 +388,12 @@ static int request_fast_irq(unsigned int irq, | |||
426 | 388 | ||
427 | INSTANTIATE(sparc_ttable) | 389 | INSTANTIATE(sparc_ttable) |
428 | #if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON | 390 | #if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON |
429 | trap_table = &trapbase_cpu1; INSTANTIATE(trap_table) | 391 | trap_table = &trapbase_cpu1; |
430 | trap_table = &trapbase_cpu2; INSTANTIATE(trap_table) | 392 | INSTANTIATE(trap_table) |
431 | trap_table = &trapbase_cpu3; INSTANTIATE(trap_table) | 393 | trap_table = &trapbase_cpu2; |
394 | INSTANTIATE(trap_table) | ||
395 | trap_table = &trapbase_cpu3; | ||
396 | INSTANTIATE(trap_table) | ||
432 | #endif | 397 | #endif |
433 | #undef INSTANTIATE | 398 | #undef INSTANTIATE |
434 | /* | 399 | /* |
@@ -454,7 +419,8 @@ out: | |||
454 | return ret; | 419 | return ret; |
455 | } | 420 | } |
456 | 421 | ||
457 | /* These variables are used to access state from the assembler | 422 | /* |
423 | * These variables are used to access state from the assembler | ||
458 | * interrupt handler, floppy_hardint, so we cannot put these in | 424 | * interrupt handler, floppy_hardint, so we cannot put these in |
459 | * the floppy driver image because that would not work in the | 425 | * the floppy driver image because that would not work in the |
460 | * modular case. | 426 | * modular case. |
@@ -477,8 +443,6 @@ EXPORT_SYMBOL(pdma_base); | |||
477 | unsigned long pdma_areasize; | 443 | unsigned long pdma_areasize; |
478 | EXPORT_SYMBOL(pdma_areasize); | 444 | EXPORT_SYMBOL(pdma_areasize); |
479 | 445 | ||
480 | extern void floppy_hardint(void); | ||
481 | |||
482 | static irq_handler_t floppy_irq_handler; | 446 | static irq_handler_t floppy_irq_handler; |
483 | 447 | ||
484 | void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) | 448 | void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) |
@@ -494,9 +458,11 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
494 | irq_exit(); | 458 | irq_exit(); |
495 | enable_pil_irq(irq); | 459 | enable_pil_irq(irq); |
496 | set_irq_regs(old_regs); | 460 | set_irq_regs(old_regs); |
497 | // XXX Eek, it's totally changed with preempt_count() and such | 461 | /* |
498 | // if (softirq_pending(cpu)) | 462 | * XXX Eek, it's totally changed with preempt_count() and such |
499 | // do_softirq(); | 463 | * if (softirq_pending(cpu)) |
464 | * do_softirq(); | ||
465 | */ | ||
500 | } | 466 | } |
501 | 467 | ||
502 | int sparc_floppy_request_irq(int irq, unsigned long flags, | 468 | int sparc_floppy_request_irq(int irq, unsigned long flags, |
@@ -511,21 +477,18 @@ EXPORT_SYMBOL(sparc_floppy_request_irq); | |||
511 | 477 | ||
512 | int request_irq(unsigned int irq, | 478 | int request_irq(unsigned int irq, |
513 | irq_handler_t handler, | 479 | irq_handler_t handler, |
514 | unsigned long irqflags, const char * devname, void *dev_id) | 480 | unsigned long irqflags, const char *devname, void *dev_id) |
515 | { | 481 | { |
516 | struct irqaction * action, **actionp; | 482 | struct irqaction *action, **actionp; |
517 | unsigned long flags; | 483 | unsigned long flags; |
518 | unsigned int cpu_irq; | 484 | unsigned int cpu_irq; |
519 | int ret; | 485 | int ret; |
520 | 486 | ||
521 | if (sparc_cpu_model == sun4d) { | 487 | if (sparc_cpu_model == sun4d) |
522 | extern int sun4d_request_irq(unsigned int, | ||
523 | irq_handler_t , | ||
524 | unsigned long, const char *, void *); | ||
525 | return sun4d_request_irq(irq, handler, irqflags, devname, dev_id); | 488 | return sun4d_request_irq(irq, handler, irqflags, devname, dev_id); |
526 | } | 489 | |
527 | cpu_irq = irq & (NR_IRQS - 1); | 490 | cpu_irq = irq & (NR_IRQS - 1); |
528 | if(cpu_irq > 14) { | 491 | if (cpu_irq > 14) { |
529 | ret = -EINVAL; | 492 | ret = -EINVAL; |
530 | goto out; | 493 | goto out; |
531 | } | 494 | } |
@@ -533,7 +496,7 @@ int request_irq(unsigned int irq, | |||
533 | ret = -EINVAL; | 496 | ret = -EINVAL; |
534 | goto out; | 497 | goto out; |
535 | } | 498 | } |
536 | 499 | ||
537 | spin_lock_irqsave(&irq_action_lock, flags); | 500 | spin_lock_irqsave(&irq_action_lock, flags); |
538 | 501 | ||
539 | actionp = &sparc_irq[cpu_irq].action; | 502 | actionp = &sparc_irq[cpu_irq].action; |
@@ -544,7 +507,8 @@ int request_irq(unsigned int irq, | |||
544 | goto out_unlock; | 507 | goto out_unlock; |
545 | } | 508 | } |
546 | if ((action->flags & IRQF_DISABLED) != (irqflags & IRQF_DISABLED)) { | 509 | if ((action->flags & IRQF_DISABLED) != (irqflags & IRQF_DISABLED)) { |
547 | printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq); | 510 | printk(KERN_ERR "Attempt to mix fast and slow interrupts on IRQ%d denied\n", |
511 | irq); | ||
548 | ret = -EBUSY; | 512 | ret = -EBUSY; |
549 | goto out_unlock; | 513 | goto out_unlock; |
550 | } | 514 | } |
@@ -559,14 +523,12 @@ int request_irq(unsigned int irq, | |||
559 | if (static_irq_count < MAX_STATIC_ALLOC) | 523 | if (static_irq_count < MAX_STATIC_ALLOC) |
560 | action = &static_irqaction[static_irq_count++]; | 524 | action = &static_irqaction[static_irq_count++]; |
561 | else | 525 | else |
562 | printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n", irq, devname); | 526 | printk(KERN_ERR "Request for IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n", |
527 | irq, devname); | ||
563 | } | 528 | } |
564 | |||
565 | if (action == NULL) | 529 | if (action == NULL) |
566 | action = kmalloc(sizeof(struct irqaction), | 530 | action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC); |
567 | GFP_ATOMIC); | 531 | if (!action) { |
568 | |||
569 | if (!action) { | ||
570 | ret = -ENOMEM; | 532 | ret = -ENOMEM; |
571 | goto out_unlock; | 533 | goto out_unlock; |
572 | } | 534 | } |
@@ -587,7 +549,6 @@ out_unlock: | |||
587 | out: | 549 | out: |
588 | return ret; | 550 | return ret; |
589 | } | 551 | } |
590 | |||
591 | EXPORT_SYMBOL(request_irq); | 552 | EXPORT_SYMBOL(request_irq); |
592 | 553 | ||
593 | void disable_irq_nosync(unsigned int irq) | 554 | void disable_irq_nosync(unsigned int irq) |
@@ -606,24 +567,22 @@ void enable_irq(unsigned int irq) | |||
606 | { | 567 | { |
607 | __enable_irq(irq); | 568 | __enable_irq(irq); |
608 | } | 569 | } |
609 | |||
610 | EXPORT_SYMBOL(enable_irq); | 570 | EXPORT_SYMBOL(enable_irq); |
611 | 571 | ||
612 | /* We really don't need these at all on the Sparc. We only have | 572 | /* |
573 | * We really don't need these at all on the Sparc. We only have | ||
613 | * stubs here because they are exported to modules. | 574 | * stubs here because they are exported to modules. |
614 | */ | 575 | */ |
615 | unsigned long probe_irq_on(void) | 576 | unsigned long probe_irq_on(void) |
616 | { | 577 | { |
617 | return 0; | 578 | return 0; |
618 | } | 579 | } |
619 | |||
620 | EXPORT_SYMBOL(probe_irq_on); | 580 | EXPORT_SYMBOL(probe_irq_on); |
621 | 581 | ||
622 | int probe_irq_off(unsigned long mask) | 582 | int probe_irq_off(unsigned long mask) |
623 | { | 583 | { |
624 | return 0; | 584 | return 0; |
625 | } | 585 | } |
626 | |||
627 | EXPORT_SYMBOL(probe_irq_off); | 586 | EXPORT_SYMBOL(probe_irq_off); |
628 | 587 | ||
629 | /* djhr | 588 | /* djhr |
@@ -636,11 +595,7 @@ EXPORT_SYMBOL(probe_irq_off); | |||
636 | 595 | ||
637 | void __init init_IRQ(void) | 596 | void __init init_IRQ(void) |
638 | { | 597 | { |
639 | extern void sun4c_init_IRQ( void ); | 598 | switch (sparc_cpu_model) { |
640 | extern void sun4m_init_IRQ( void ); | ||
641 | extern void sun4d_init_IRQ( void ); | ||
642 | |||
643 | switch(sparc_cpu_model) { | ||
644 | case sun4c: | 599 | case sun4c: |
645 | case sun4: | 600 | case sun4: |
646 | sun4c_init_IRQ(); | 601 | sun4c_init_IRQ(); |
@@ -656,7 +611,7 @@ void __init init_IRQ(void) | |||
656 | #endif | 611 | #endif |
657 | sun4m_init_IRQ(); | 612 | sun4m_init_IRQ(); |
658 | break; | 613 | break; |
659 | 614 | ||
660 | case sun4d: | 615 | case sun4d: |
661 | sun4d_init_IRQ(); | 616 | sun4d_init_IRQ(); |
662 | break; | 617 | break; |