summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/irq.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-08-02 00:19:14 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-08-03 14:08:42 -0700
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 75b2240ad0f..b76dc03fc31 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)
set_irq_regs(old_regs);
}
-#ifdef CONFIG_BLK_DEV_FD
-extern void floppy_interrupt(int irq, void *dev_id);
-
-void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
-{
- struct pt_regs *old_regs;
- int cpu = smp_processor_id();
-
- old_regs = set_irq_regs(regs);
- disable_pil_irq(irq);
- irq_enter();
- kstat_cpu(cpu).irqs[irq]++;
- floppy_interrupt(irq, dev_id);
- irq_exit();
- enable_pil_irq(irq);
- set_irq_regs(old_regs);
- // XXX Eek, it's totally changed with preempt_count() and such
- // if (softirq_pending(cpu))
- // do_softirq();
-}
-#endif
+#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
/* Fast IRQs on the Sparc can only have one routine attached to them,
* thus no sharing possible.
*/
-int request_fast_irq(unsigned int irq,
- irq_handler_t handler,
- unsigned long irqflags, const char *devname)
+static int request_fast_irq(unsigned int irq,
+ void (*handler)(void),
+ unsigned long irqflags, const char *devname)
{
struct irqaction *action;
unsigned long flags;
@@ -457,7 +437,6 @@ int request_fast_irq(unsigned int irq,
*/
flush_cache_all();
- action->handler = handler;
action->flags = irqflags;
cpus_clear(action->mask);
action->name = devname;
@@ -475,6 +454,61 @@ out:
return ret;
}
+/* These variables are used to access state from the assembler
+ * interrupt handler, floppy_hardint, so we cannot put these in
+ * the floppy driver image because that would not work in the
+ * modular case.
+ */
+volatile unsigned char *fdc_status;
+EXPORT_SYMBOL(fdc_status);
+
+char *pdma_vaddr;
+EXPORT_SYMBOL(pdma_vaddr);
+
+unsigned long pdma_size;
+EXPORT_SYMBOL(pdma_size);
+
+volatile int doing_pdma;
+EXPORT_SYMBOL(doing_pdma);
+
+char *pdma_base;
+EXPORT_SYMBOL(pdma_base);
+
+unsigned long pdma_areasize;
+EXPORT_SYMBOL(pdma_areasize);
+
+extern void floppy_hardint(void);
+
+static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id);
+
+void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+ struct pt_regs *old_regs;
+ int cpu = smp_processor_id();
+
+ old_regs = set_irq_regs(regs);
+ disable_pil_irq(irq);
+ irq_enter();
+ kstat_cpu(cpu).irqs[irq]++;
+ floppy_irq_handler(irq, dev_id);
+ irq_exit();
+ enable_pil_irq(irq);
+ set_irq_regs(old_regs);
+ // XXX Eek, it's totally changed with preempt_count() and such
+ // if (softirq_pending(cpu))
+ // do_softirq();
+}
+
+int sparc_floppy_request_irq(int irq, unsigned long flags,
+ irqreturn_t (*irq_handler)(int irq, void *))
+{
+ floppy_irq_handler = irq_handler;
+ return request_fast_irq(irq, floppy_hardint, flags, "floppy");
+}
+EXPORT_SYMBOL(sparc_floppy_request_irq);
+
+#endif
+
int request_irq(unsigned int irq,
irq_handler_t handler,
unsigned long irqflags, const char * devname, void *dev_id)