aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--include/asm-sparc/floppy.h20
-rw-r--r--include/asm-sparc/irq.h7
5 files changed, 75 insertions, 44 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); */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index 28ce2b9c3da8..acd06d8ff70a 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -48,7 +48,7 @@ struct sun_flpy_controller {
48 48
49/* You'll only ever find one controller on a SparcStation anyways. */ 49/* You'll only ever find one controller on a SparcStation anyways. */
50static struct sun_flpy_controller *sun_fdc = NULL; 50static struct sun_flpy_controller *sun_fdc = NULL;
51volatile unsigned char *fdc_status; 51extern volatile unsigned char *fdc_status;
52 52
53struct sun_floppy_ops { 53struct sun_floppy_ops {
54 unsigned char (*fd_inb)(int port); 54 unsigned char (*fd_inb)(int port);
@@ -225,13 +225,13 @@ static void sun_82077_fd_outb(unsigned char value, int port)
225 * underruns. If non-zero, doing_pdma encodes the direction of 225 * underruns. If non-zero, doing_pdma encodes the direction of
226 * the transfer for debugging. 1=read 2=write 226 * the transfer for debugging. 1=read 2=write
227 */ 227 */
228char *pdma_vaddr; 228extern char *pdma_vaddr;
229unsigned long pdma_size; 229extern unsigned long pdma_size;
230volatile int doing_pdma = 0; 230extern volatile int doing_pdma;
231 231
232/* This is software state */ 232/* This is software state */
233char *pdma_base = NULL; 233extern char *pdma_base;
234unsigned long pdma_areasize; 234extern unsigned long pdma_areasize;
235 235
236/* Common routines to all controller types on the Sparc. */ 236/* Common routines to all controller types on the Sparc. */
237static __inline__ void virtual_dma_init(void) 237static __inline__ void virtual_dma_init(void)
@@ -281,7 +281,8 @@ static __inline__ void sun_fd_enable_dma(void)
281} 281}
282 282
283/* Our low-level entry point in arch/sparc/kernel/entry.S */ 283/* Our low-level entry point in arch/sparc/kernel/entry.S */
284irqreturn_t floppy_hardint(int irq, void *unused); 284extern int sparc_floppy_request_irq(int irq, unsigned long flags,
285 irqreturn_t (*irq_handler)(int irq, void *));
285 286
286static int sun_fd_request_irq(void) 287static int sun_fd_request_irq(void)
287{ 288{
@@ -290,8 +291,9 @@ static int sun_fd_request_irq(void)
290 291
291 if(!once) { 292 if(!once) {
292 once = 1; 293 once = 1;
293 error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, 294 error = sparc_floppy_request_irq(FLOPPY_IRQ,
294 IRQF_DISABLED, "floppy"); 295 IRQF_DISABLED,
296 floppy_interrupt);
295 return ((error == 0) ? 0 : -1); 297 return ((error == 0) ? 0 : -1);
296 } else return 0; 298 } else return 0;
297} 299}
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index 61fb99643afd..fe205cc444b8 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,7 +1,6 @@
1/* $Id: irq.h,v 1.32 2000/08/26 02:42:28 anton Exp $ 1/* irq.h: IRQ registers on the Sparc.
2 * irq.h: IRQ registers on the Sparc.
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 */ 4 */
6 5
7#ifndef _SPARC_IRQ_H 6#ifndef _SPARC_IRQ_H
@@ -13,6 +12,4 @@
13 12
14#define irq_canonicalize(irq) (irq) 13#define irq_canonicalize(irq) (irq)
15 14
16extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname);
17
18#endif 15#endif