diff options
Diffstat (limited to 'arch/sparc/kernel/irq.c')
-rw-r--r-- | arch/sparc/kernel/irq.c | 84 |
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) |
355 | extern void floppy_interrupt(int irq, void *dev_id); | ||
356 | |||
357 | void 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 | */ |
379 | int request_fast_irq(unsigned int irq, | 359 | static 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 | */ | ||
462 | volatile unsigned char *fdc_status; | ||
463 | EXPORT_SYMBOL(fdc_status); | ||
464 | |||
465 | char *pdma_vaddr; | ||
466 | EXPORT_SYMBOL(pdma_vaddr); | ||
467 | |||
468 | unsigned long pdma_size; | ||
469 | EXPORT_SYMBOL(pdma_size); | ||
470 | |||
471 | volatile int doing_pdma; | ||
472 | EXPORT_SYMBOL(doing_pdma); | ||
473 | |||
474 | char *pdma_base; | ||
475 | EXPORT_SYMBOL(pdma_base); | ||
476 | |||
477 | unsigned long pdma_areasize; | ||
478 | EXPORT_SYMBOL(pdma_areasize); | ||
479 | |||
480 | extern void floppy_hardint(void); | ||
481 | |||
482 | static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id); | ||
483 | |||
484 | void 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 | |||
502 | int 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 | } | ||
508 | EXPORT_SYMBOL(sparc_floppy_request_irq); | ||
509 | |||
510 | #endif | ||
511 | |||
478 | int request_irq(unsigned int irq, | 512 | int 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) |