aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/irq.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-08-02 03:19:14 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-08-03 17:08:42 -0400
commit0a808a3131b2a6656475d82219f5e5d25edd7160 (patch)
tree12a4f0690bf01ccc9956ba974dd64237ee9f807c /arch/sparc/kernel/irq.c
parent3daadf33013a1c4d7abf4a65b24644cdd8ae896a (diff)
[SPARC32]: Fix modular build of floppy driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/irq.c')
-rw-r--r--arch/sparc/kernel/irq.c84
1 files changed, 59 insertions, 25 deletions
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 75b2240ad0f9..b76dc03fc318 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -351,34 +351,14 @@ void handler_irq(int irq, struct pt_regs * regs)
351 set_irq_regs(old_regs); 351 set_irq_regs(old_regs);
352} 352}
353 353
354#ifdef CONFIG_BLK_DEV_FD 354#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
355extern void floppy_interrupt(int irq, void *dev_id);
356
357void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
358{
359 struct pt_regs *old_regs;
360 int cpu = smp_processor_id();
361
362 old_regs = set_irq_regs(regs);
363 disable_pil_irq(irq);
364 irq_enter();
365 kstat_cpu(cpu).irqs[irq]++;
366 floppy_interrupt(irq, dev_id);
367 irq_exit();
368 enable_pil_irq(irq);
369 set_irq_regs(old_regs);
370 // XXX Eek, it's totally changed with preempt_count() and such
371 // if (softirq_pending(cpu))
372 // do_softirq();
373}
374#endif
375 355
376/* Fast IRQs on the Sparc can only have one routine attached to them, 356/* Fast IRQs on the Sparc can only have one routine attached to them,
377 * thus no sharing possible. 357 * thus no sharing possible.
378 */ 358 */
379int request_fast_irq(unsigned int irq, 359static int request_fast_irq(unsigned int irq,
380 irq_handler_t handler, 360 void (*handler)(void),
381 unsigned long irqflags, const char *devname) 361 unsigned long irqflags, const char *devname)
382{ 362{
383 struct irqaction *action; 363 struct irqaction *action;
384 unsigned long flags; 364 unsigned long flags;
@@ -457,7 +437,6 @@ int request_fast_irq(unsigned int irq,
457 */ 437 */
458 flush_cache_all(); 438 flush_cache_all();
459 439
460 action->handler = handler;
461 action->flags = irqflags; 440 action->flags = irqflags;
462 cpus_clear(action->mask); 441 cpus_clear(action->mask);
463 action->name = devname; 442 action->name = devname;
@@ -475,6 +454,61 @@ out:
475 return ret; 454 return ret;
476} 455}
477 456
457/* These variables are used to access state from the assembler
458 * interrupt handler, floppy_hardint, so we cannot put these in
459 * the floppy driver image because that would not work in the
460 * modular case.
461 */
462volatile unsigned char *fdc_status;
463EXPORT_SYMBOL(fdc_status);
464
465char *pdma_vaddr;
466EXPORT_SYMBOL(pdma_vaddr);
467
468unsigned long pdma_size;
469EXPORT_SYMBOL(pdma_size);
470
471volatile int doing_pdma;
472EXPORT_SYMBOL(doing_pdma);
473
474char *pdma_base;
475EXPORT_SYMBOL(pdma_base);
476
477unsigned long pdma_areasize;
478EXPORT_SYMBOL(pdma_areasize);
479
480extern void floppy_hardint(void);
481
482static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id);
483
484void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
485{
486 struct pt_regs *old_regs;
487 int cpu = smp_processor_id();
488
489 old_regs = set_irq_regs(regs);
490 disable_pil_irq(irq);
491 irq_enter();
492 kstat_cpu(cpu).irqs[irq]++;
493 floppy_irq_handler(irq, dev_id);
494 irq_exit();
495 enable_pil_irq(irq);
496 set_irq_regs(old_regs);
497 // XXX Eek, it's totally changed with preempt_count() and such
498 // if (softirq_pending(cpu))
499 // do_softirq();
500}
501
502int sparc_floppy_request_irq(int irq, unsigned long flags,
503 irqreturn_t (*irq_handler)(int irq, void *))
504{
505 floppy_irq_handler = irq_handler;
506 return request_fast_irq(irq, floppy_hardint, flags, "floppy");
507}
508EXPORT_SYMBOL(sparc_floppy_request_irq);
509
510#endif
511
478int request_irq(unsigned int irq, 512int request_irq(unsigned int irq,
479 irq_handler_t handler, 513 irq_handler_t handler,
480 unsigned long irqflags, const char * devname, void *dev_id) 514 unsigned long irqflags, const char * devname, void *dev_id)