aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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
parent3daadf33013a1c4d7abf4a65b24644cdd8ae896a (diff)
[SPARC32]: Fix modular build of floppy driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/entry.S7
-rw-r--r--arch/sparc/kernel/irq.c84
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c1
3 files changed, 62 insertions, 30 deletions
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index eac38388f5fd..88d2cefd01be 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -1,7 +1,6 @@
1/* $Id: entry.S,v 1.170 2001/11/13 00:57:05 davem Exp $ 1/* arch/sparc/kernel/entry.S: Sparc trap low-level entry points.
2 * arch/sparc/kernel/entry.S: Sparc trap low-level entry points.
3 * 2 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
7 * Copyright (C) 1996-1999 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 6 * Copyright (C) 1996-1999 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -129,7 +128,7 @@ trap_low:
129 RESTORE_ALL 128 RESTORE_ALL
130#endif 129#endif
131 130
132#ifdef CONFIG_BLK_DEV_FD 131#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
133 .text 132 .text
134 .align 4 133 .align 4
135 .globl floppy_hardint 134 .globl floppy_hardint
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)
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 7b4abde43028..ef647acc479e 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -143,7 +143,6 @@ EXPORT_SYMBOL(mstk48t02_regs);
143EXPORT_SYMBOL(set_auxio); 143EXPORT_SYMBOL(set_auxio);
144EXPORT_SYMBOL(get_auxio); 144EXPORT_SYMBOL(get_auxio);
145#endif 145#endif
146EXPORT_SYMBOL(request_fast_irq);
147EXPORT_SYMBOL(io_remap_pfn_range); 146EXPORT_SYMBOL(io_remap_pfn_range);
148 /* P3: iounit_xxx may be needed, sun4d users */ 147 /* P3: iounit_xxx may be needed, sun4d users */
149/* EXPORT_SYMBOL(iounit_map_dma_init); */ 148/* EXPORT_SYMBOL(iounit_map_dma_init); */