MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / arch / arm / kernel / irq.c
blobce6f4009168d6e64226a2fbd1eff069d4122b28c
1 /*
2 * linux/arch/arm/kernel/irq.c
4 * Copyright (C) 1992 Linus Torvalds
5 * Modifications for ARM processor Copyright (C) 1995-2000 Russell King.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This file contains the code used by various IRQ handling routines:
12 * asking for different IRQ's should be done through these routines
13 * instead of just grabbing them. Thus setups with different IRQ numbers
14 * shouldn't result in any weird surprises, and installing new handlers
15 * should be easier.
17 * IRQ's are in fact implemented a bit like signal handlers for the kernel.
18 * Naturally it's not a 1:1 relation, but there are similarities.
20 #include <linux/config.h>
21 #include <linux/kernel_stat.h>
22 #include <linux/module.h>
23 #include <linux/signal.h>
24 #include <linux/ioport.h>
25 #include <linux/interrupt.h>
26 #include <linux/ptrace.h>
27 #include <linux/slab.h>
28 #include <linux/random.h>
29 #include <linux/smp.h>
30 #include <linux/init.h>
31 #include <linux/seq_file.h>
32 #include <linux/errno.h>
33 #include <linux/list.h>
34 #include <linux/kallsyms.h>
36 #include <asm/irq.h>
37 #include <asm/system.h>
38 #include <asm/mach/irq.h>
39 #ifdef CONFIG_ARCH_MOXACPU
40 #include <asm/arch/irq.h>
41 #endif
44 * Maximum IRQ count. Currently, this is arbitary. However, it should
45 * not be set too low to prevent false triggering. Conversely, if it
46 * is set too high, then you could miss a stuck IRQ.
48 * Maybe we ought to set a timer and re-enable the IRQ at a later time?
50 #define MAX_IRQ_CNT 100000
52 static int noirqdebug;
53 static volatile unsigned long irq_err_count;
54 static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;
55 static LIST_HEAD(irq_pending);
57 struct irqdesc irq_desc[NR_IRQS];
58 void (*init_arch_irq)(void) __initdata = NULL;
61 * Dummy mask/unmask handler
63 void dummy_mask_unmask_irq(unsigned int irq)
67 irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs)
69 return IRQ_NONE;
72 void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
74 irq_err_count += 1;
75 printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
78 static struct irqchip bad_chip = {
79 .ack = dummy_mask_unmask_irq,
80 .mask = dummy_mask_unmask_irq,
81 .unmask = dummy_mask_unmask_irq,
84 static struct irqdesc bad_irq_desc = {
85 .chip = &bad_chip,
86 .handle = do_bad_IRQ,
87 .pend = LIST_HEAD_INIT(bad_irq_desc.pend),
88 .disable_depth = 1,
91 /**
92 * disable_irq - disable an irq and wait for completion
93 * @irq: Interrupt to disable
95 * Disable the selected interrupt line. Enables and disables
96 * are nested. We do this lazily.
98 * This function may be called from IRQ context.
100 void disable_irq(unsigned int irq)
102 struct irqdesc *desc = irq_desc + irq;
103 unsigned long flags;
105 spin_lock_irqsave(&irq_controller_lock, flags);
106 desc->disable_depth++;
107 list_del_init(&desc->pend);
108 spin_unlock_irqrestore(&irq_controller_lock, flags);
110 EXPORT_SYMBOL(disable_irq);
113 * enable_irq - enable interrupt handling on an irq
114 * @irq: Interrupt to enable
116 * Re-enables the processing of interrupts on this IRQ line.
117 * Note that this may call the interrupt handler, so you may
118 * get unexpected results if you hold IRQs disabled.
120 * This function may be called from IRQ context.
122 void enable_irq(unsigned int irq)
124 struct irqdesc *desc = irq_desc + irq;
125 unsigned long flags;
127 spin_lock_irqsave(&irq_controller_lock, flags);
128 if (unlikely(!desc->disable_depth)) {
129 printk("enable_irq(%u) unbalanced from %p\n", irq,
130 __builtin_return_address(0));
131 } else if (!--desc->disable_depth) {
132 desc->probing = 0;
133 desc->chip->unmask(irq);
136 * If the interrupt is waiting to be processed,
137 * try to re-run it. We can't directly run it
138 * from here since the caller might be in an
139 * interrupt-protected region.
141 if (desc->pending && list_empty(&desc->pend)) {
142 desc->pending = 0;
143 if (!desc->chip->retrigger ||
144 desc->chip->retrigger(irq))
145 list_add(&desc->pend, &irq_pending);
148 spin_unlock_irqrestore(&irq_controller_lock, flags);
150 EXPORT_SYMBOL(enable_irq);
153 * Enable wake on selected irq
155 void enable_irq_wake(unsigned int irq)
157 struct irqdesc *desc = irq_desc + irq;
158 unsigned long flags;
160 spin_lock_irqsave(&irq_controller_lock, flags);
161 if (desc->chip->wake)
162 desc->chip->wake(irq, 1);
163 spin_unlock_irqrestore(&irq_controller_lock, flags);
165 EXPORT_SYMBOL(enable_irq_wake);
167 void disable_irq_wake(unsigned int irq)
169 struct irqdesc *desc = irq_desc + irq;
170 unsigned long flags;
172 spin_lock_irqsave(&irq_controller_lock, flags);
173 if (desc->chip->wake)
174 desc->chip->wake(irq, 0);
175 spin_unlock_irqrestore(&irq_controller_lock, flags);
177 EXPORT_SYMBOL(disable_irq_wake);
179 int show_interrupts(struct seq_file *p, void *v)
181 int i = *(loff_t *) v;
182 struct irqaction * action;
183 unsigned long flags;
185 if (i < NR_IRQS) {
186 spin_lock_irqsave(&irq_controller_lock, flags);
187 action = irq_desc[i].action;
188 if (!action)
189 goto unlock;
191 seq_printf(p, "%3d: %10u ", i, kstat_irqs(i));
192 seq_printf(p, " %s", action->name);
193 for (action = action->next; action; action = action->next)
194 seq_printf(p, ", %s", action->name);
196 seq_putc(p, '\n');
197 unlock:
198 spin_unlock_irqrestore(&irq_controller_lock, flags);
199 } else if (i == NR_IRQS) {
200 #ifdef CONFIG_ARCH_ACORN
201 show_fiq_list(p, v);
202 #endif
203 seq_printf(p, "Err: %10lu\n", irq_err_count);
205 return 0;
209 * IRQ lock detection.
211 * Hopefully, this should get us out of a few locked situations.
212 * However, it may take a while for this to happen, since we need
213 * a large number if IRQs to appear in the same jiffie with the
214 * same instruction pointer (or within 2 instructions).
216 static int check_irq_lock(struct irqdesc *desc, int irq, struct pt_regs *regs)
218 unsigned long instr_ptr = instruction_pointer(regs);
220 if (desc->lck_jif == jiffies &&
221 desc->lck_pc >= instr_ptr && desc->lck_pc < instr_ptr + 8) {
222 desc->lck_cnt += 1;
224 if (desc->lck_cnt > MAX_IRQ_CNT) {
225 printk(KERN_ERR "IRQ LOCK: IRQ%d is locking the system, disabled\n", irq);
226 return 1;
228 } else {
229 desc->lck_cnt = 0;
230 desc->lck_pc = instruction_pointer(regs);
231 desc->lck_jif = jiffies;
233 return 0;
236 static void
237 report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int ret)
239 static int count = 100;
240 struct irqaction *action;
242 if (!count || noirqdebug)
243 return;
245 count--;
247 if (ret != IRQ_HANDLED && ret != IRQ_NONE) {
248 printk("irq%u: bogus retval mask %x\n", irq, ret);
249 } else {
250 printk("irq%u: nobody cared\n", irq);
252 show_regs(regs);
253 dump_stack();
254 printk(KERN_ERR "handlers:");
255 action = desc->action;
256 do {
257 printk("\n" KERN_ERR "[<%p>]", action->handler);
258 print_symbol(" (%s)", (unsigned long)action->handler);
259 action = action->next;
260 } while (action);
261 printk("\n");
264 static int
265 __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
267 unsigned int status;
268 int ret, retval = 0;
270 spin_unlock(&irq_controller_lock);
272 if (!(action->flags & SA_INTERRUPT)) {
273 local_irq_enable();
276 status = 0;
277 do {
278 ret = action->handler(irq, action->dev_id, regs);
279 if (ret == IRQ_HANDLED) {
280 status |= action->flags;
282 retval |= ret;
283 action = action->next;
284 } while (action);
286 if (status & SA_SAMPLE_RANDOM) {
287 add_interrupt_randomness(irq);
290 spin_lock_irq(&irq_controller_lock);
292 return retval;
296 * This is for software-decoded IRQs. The caller is expected to
297 * handle the ack, clear, mask and unmask issues.
299 void
300 do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
302 struct irqaction *action;
303 const int cpu = smp_processor_id();
305 desc->triggered = 1;
307 kstat_cpu(cpu).irqs[irq]++;
309 action = desc->action;
310 if (action) {
311 int ret = __do_irq(irq, action, regs);
312 if (ret != IRQ_HANDLED)
313 report_bad_irq(irq, regs, desc, ret);
318 * Most edge-triggered IRQ implementations seem to take a broken
319 * approach to this. Hence the complexity.
321 void
322 do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
324 const int cpu = smp_processor_id();
326 desc->triggered = 1;
329 * If we're currently running this IRQ, or its disabled,
330 * we shouldn't process the IRQ. Instead, turn on the
331 * hardware masks.
333 if (unlikely(desc->running || desc->disable_depth))
334 goto running;
337 * Acknowledge and clear the IRQ, but don't mask it.
339 desc->chip->ack(irq);
342 * Mark the IRQ currently in progress.
344 desc->running = 1;
346 kstat_cpu(cpu).irqs[irq]++;
348 do {
349 struct irqaction *action;
350 int ret;
352 action = desc->action;
353 if (!action)
354 break;
356 if (desc->pending && !desc->disable_depth) {
357 desc->pending = 0;
358 desc->chip->unmask(irq);
361 ret = __do_irq(irq, action, regs);
362 if (ret != IRQ_HANDLED)
363 report_bad_irq(irq, regs, desc, ret);
364 } while (desc->pending && !desc->disable_depth);
366 desc->running = 0;
369 * If we were disabled or freed, shut down the handler.
371 if (likely(desc->action && !check_irq_lock(desc, irq, regs)))
372 return;
374 running:
376 * We got another IRQ while this one was masked or
377 * currently running. Delay it.
379 desc->pending = 1;
380 desc->chip->mask(irq);
381 desc->chip->ack(irq);
385 * Level-based IRQ handler. Nice and simple.
387 void
388 do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
390 struct irqaction *action;
391 const int cpu = smp_processor_id();
393 desc->triggered = 1;
396 * Acknowledge, clear _AND_ disable the interrupt.
398 desc->chip->ack(irq);
400 if (likely(!desc->disable_depth)) {
401 kstat_cpu(cpu).irqs[irq]++;
404 * Return with this interrupt masked if no action
406 action = desc->action;
407 if (action) {
408 int ret = __do_irq(irq, desc->action, regs);
410 if (ret != IRQ_HANDLED) {
411 report_bad_irq(irq, regs, desc, ret);
414 if (likely(!desc->disable_depth &&
415 !check_irq_lock(desc, irq, regs))) {
416 desc->chip->unmask(irq);
422 static void do_pending_irqs(struct pt_regs *regs)
424 struct list_head head, *l, *n;
426 do {
427 struct irqdesc *desc;
430 * First, take the pending interrupts off the list.
431 * The act of calling the handlers may add some IRQs
432 * back onto the list.
434 head = irq_pending;
435 INIT_LIST_HEAD(&irq_pending);
436 head.next->prev = &head;
437 head.prev->next = &head;
440 * Now run each entry. We must delete it from our
441 * list before calling the handler.
443 list_for_each_safe(l, n, &head) {
444 desc = list_entry(l, struct irqdesc, pend);
445 list_del_init(&desc->pend);
446 desc->handle(desc - irq_desc, desc, regs);
450 * The list must be empty.
452 BUG_ON(!list_empty(&head));
453 } while (!list_empty(&irq_pending));
457 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
458 * come via this function. Instead, they should provide their
459 * own 'handler'
461 asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
463 #ifdef CONFIG_ARCH_MOXACPU // add by Victor Yu. 11-02-2005
464 struct irqdesc *desc;
465 #else
466 struct irqdesc *desc = irq_desc + irq;
467 #endif
469 #ifdef CONFIG_ARCH_MOXACPU
470 irq = fixup_irq(irq);
471 desc = irq_desc + irq;
472 #endif
474 * Some hardware gives randomly wrong interrupts. Rather
475 * than crashing, do something sensible.
477 if (irq >= NR_IRQS)
478 desc = &bad_irq_desc;
480 irq_enter();
481 spin_lock(&irq_controller_lock);
482 desc->handle(irq, desc, regs);
485 * Now re-run any pending interrupts.
487 if (!list_empty(&irq_pending))
488 do_pending_irqs(regs);
490 spin_unlock(&irq_controller_lock);
491 irq_exit();
494 void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
496 struct irqdesc *desc;
497 unsigned long flags;
499 if (irq >= NR_IRQS) {
500 printk(KERN_ERR "Trying to install handler for IRQ%d\n", irq);
501 return;
504 if (handle == NULL)
505 handle = do_bad_IRQ;
507 desc = irq_desc + irq;
509 if (is_chained && desc->chip == &bad_chip)
510 printk(KERN_WARNING "Trying to install chained handler for IRQ%d\n", irq);
512 spin_lock_irqsave(&irq_controller_lock, flags);
513 if (handle == do_bad_IRQ) {
514 desc->chip->mask(irq);
515 desc->chip->ack(irq);
516 desc->disable_depth = 1;
518 desc->handle = handle;
519 if (handle != do_bad_IRQ && is_chained) {
520 desc->valid = 0;
521 desc->probe_ok = 0;
522 desc->disable_depth = 0;
523 desc->chip->unmask(irq);
525 spin_unlock_irqrestore(&irq_controller_lock, flags);
528 void set_irq_chip(unsigned int irq, struct irqchip *chip)
530 struct irqdesc *desc;
531 unsigned long flags;
533 if (irq >= NR_IRQS) {
534 printk(KERN_ERR "Trying to install chip for IRQ%d\n", irq);
535 return;
538 if (chip == NULL)
539 chip = &bad_chip;
541 desc = irq_desc + irq;
542 spin_lock_irqsave(&irq_controller_lock, flags);
543 desc->chip = chip;
544 spin_unlock_irqrestore(&irq_controller_lock, flags);
547 int set_irq_type(unsigned int irq, unsigned int type)
549 struct irqdesc *desc;
550 unsigned long flags;
551 int ret = -ENXIO;
553 if (irq >= NR_IRQS) {
554 printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq);
555 return -ENODEV;
558 desc = irq_desc + irq;
559 if (desc->chip->type) {
560 spin_lock_irqsave(&irq_controller_lock, flags);
561 ret = desc->chip->type(irq, type);
562 spin_unlock_irqrestore(&irq_controller_lock, flags);
565 return ret;
567 EXPORT_SYMBOL(set_irq_type);
569 void set_irq_flags(unsigned int irq, unsigned int iflags)
571 struct irqdesc *desc;
572 unsigned long flags;
574 if (irq >= NR_IRQS) {
575 printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
576 return;
579 desc = irq_desc + irq;
580 spin_lock_irqsave(&irq_controller_lock, flags);
581 desc->valid = (iflags & IRQF_VALID) != 0;
582 desc->probe_ok = (iflags & IRQF_PROBE) != 0;
583 desc->noautoenable = (iflags & IRQF_NOAUTOEN) != 0;
584 spin_unlock_irqrestore(&irq_controller_lock, flags);
587 int setup_irq(unsigned int irq, struct irqaction *new)
589 int shared = 0;
590 struct irqaction *old, **p;
591 unsigned long flags;
592 struct irqdesc *desc;
595 * Some drivers like serial.c use request_irq() heavily,
596 * so we have to be careful not to interfere with a
597 * running system.
599 if (new->flags & SA_SAMPLE_RANDOM) {
601 * This function might sleep, we want to call it first,
602 * outside of the atomic block.
603 * Yes, this might clear the entropy pool if the wrong
604 * driver is attempted to be loaded, without actually
605 * installing a new handler, but is this really a problem,
606 * only the sysadmin is able to do this.
608 rand_initialize_irq(irq);
612 * The following block of code has to be executed atomically
614 desc = irq_desc + irq;
615 spin_lock_irqsave(&irq_controller_lock, flags);
616 p = &desc->action;
617 if ((old = *p) != NULL) {
618 /* Can't share interrupts unless both agree to */
619 if (!(old->flags & new->flags & SA_SHIRQ)) {
620 spin_unlock_irqrestore(&irq_controller_lock, flags);
621 return -EBUSY;
624 /* add new interrupt at end of irq queue */
625 do {
626 p = &old->next;
627 old = *p;
628 } while (old);
629 shared = 1;
632 *p = new;
634 if (!shared) {
635 desc->probing = 0;
636 desc->running = 0;
637 desc->pending = 0;
638 desc->disable_depth = 1;
639 if (!desc->noautoenable) {
640 desc->disable_depth = 0;
641 desc->chip->unmask(irq);
645 spin_unlock_irqrestore(&irq_controller_lock, flags);
646 return 0;
650 * request_irq - allocate an interrupt line
651 * @irq: Interrupt line to allocate
652 * @handler: Function to be called when the IRQ occurs
653 * @irqflags: Interrupt type flags
654 * @devname: An ascii name for the claiming device
655 * @dev_id: A cookie passed back to the handler function
657 * This call allocates interrupt resources and enables the
658 * interrupt line and IRQ handling. From the point this
659 * call is made your handler function may be invoked. Since
660 * your handler function must clear any interrupt the board
661 * raises, you must take care both to initialise your hardware
662 * and to set up the interrupt handler in the right order.
664 * Dev_id must be globally unique. Normally the address of the
665 * device data structure is used as the cookie. Since the handler
666 * receives this value it makes sense to use it.
668 * If your interrupt is shared you must pass a non NULL dev_id
669 * as this is required when freeing the interrupt.
671 * Flags:
673 * SA_SHIRQ Interrupt is shared
675 * SA_INTERRUPT Disable local interrupts while processing
677 * SA_SAMPLE_RANDOM The interrupt can be used for entropy
680 int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
681 unsigned long irq_flags, const char * devname, void *dev_id)
683 unsigned long retval;
684 struct irqaction *action;
686 if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler ||
687 (irq_flags & SA_SHIRQ && !dev_id))
688 return -EINVAL;
690 action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
691 if (!action)
692 return -ENOMEM;
694 action->handler = handler;
695 action->flags = irq_flags;
696 cpus_clear(action->mask);
697 action->name = devname;
698 action->next = NULL;
699 action->dev_id = dev_id;
701 retval = setup_irq(irq, action);
703 if (retval)
704 kfree(action);
705 return retval;
708 EXPORT_SYMBOL(request_irq);
711 * free_irq - free an interrupt
712 * @irq: Interrupt line to free
713 * @dev_id: Device identity to free
715 * Remove an interrupt handler. The handler is removed and if the
716 * interrupt line is no longer in use by any driver it is disabled.
717 * On a shared IRQ the caller must ensure the interrupt is disabled
718 * on the card it drives before calling this function.
720 * This function must not be called from interrupt context.
722 void free_irq(unsigned int irq, void *dev_id)
724 struct irqaction * action, **p;
725 unsigned long flags;
727 if (irq >= NR_IRQS || !irq_desc[irq].valid) {
728 printk(KERN_ERR "Trying to free IRQ%d\n",irq);
729 dump_stack();
730 return;
733 spin_lock_irqsave(&irq_controller_lock, flags);
734 for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) {
735 if (action->dev_id != dev_id)
736 continue;
738 /* Found it - now free it */
739 *p = action->next;
740 break;
742 spin_unlock_irqrestore(&irq_controller_lock, flags);
744 if (!action) {
745 printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
746 dump_stack();
747 } else {
748 synchronize_irq(irq);
749 kfree(action);
753 EXPORT_SYMBOL(free_irq);
755 static DECLARE_MUTEX(probe_sem);
757 /* Start the interrupt probing. Unlike other architectures,
758 * we don't return a mask of interrupts from probe_irq_on,
759 * but return the number of interrupts enabled for the probe.
760 * The interrupts which have been enabled for probing is
761 * instead recorded in the irq_desc structure.
763 unsigned long probe_irq_on(void)
765 unsigned int i, irqs = 0;
766 unsigned long delay;
768 down(&probe_sem);
771 * first snaffle up any unassigned but
772 * probe-able interrupts
774 spin_lock_irq(&irq_controller_lock);
775 for (i = 0; i < NR_IRQS; i++) {
776 if (!irq_desc[i].probe_ok || irq_desc[i].action)
777 continue;
779 irq_desc[i].probing = 1;
780 irq_desc[i].triggered = 0;
781 if (irq_desc[i].chip->type)
782 irq_desc[i].chip->type(i, IRQT_PROBE);
783 irq_desc[i].chip->unmask(i);
784 irqs += 1;
786 spin_unlock_irq(&irq_controller_lock);
789 * wait for spurious interrupts to mask themselves out again
791 for (delay = jiffies + HZ/10; time_before(jiffies, delay); )
792 /* min 100ms delay */;
795 * now filter out any obviously spurious interrupts
797 spin_lock_irq(&irq_controller_lock);
798 for (i = 0; i < NR_IRQS; i++) {
799 if (irq_desc[i].probing && irq_desc[i].triggered) {
800 irq_desc[i].probing = 0;
801 irqs -= 1;
804 spin_unlock_irq(&irq_controller_lock);
806 return irqs;
809 EXPORT_SYMBOL(probe_irq_on);
811 unsigned int probe_irq_mask(unsigned long irqs)
813 unsigned int mask = 0, i;
815 spin_lock_irq(&irq_controller_lock);
816 for (i = 0; i < 16 && i < NR_IRQS; i++)
817 if (irq_desc[i].probing && irq_desc[i].triggered)
818 mask |= 1 << i;
819 spin_unlock_irq(&irq_controller_lock);
821 up(&probe_sem);
823 return mask;
825 EXPORT_SYMBOL(probe_irq_mask);
828 * Possible return values:
829 * >= 0 - interrupt number
830 * -1 - no interrupt/many interrupts
832 int probe_irq_off(unsigned long irqs)
834 unsigned int i;
835 int irq_found = NO_IRQ;
838 * look at the interrupts, and find exactly one
839 * that we were probing has been triggered
841 spin_lock_irq(&irq_controller_lock);
842 for (i = 0; i < NR_IRQS; i++) {
843 if (irq_desc[i].probing &&
844 irq_desc[i].triggered) {
845 if (irq_found != NO_IRQ) {
846 irq_found = NO_IRQ;
847 goto out;
849 irq_found = i;
853 if (irq_found == -1)
854 irq_found = NO_IRQ;
855 out:
856 spin_unlock_irq(&irq_controller_lock);
858 up(&probe_sem);
860 return irq_found;
863 EXPORT_SYMBOL(probe_irq_off);
865 void __init init_irq_proc(void)
869 void __init init_IRQ(void)
871 struct irqdesc *desc;
872 extern void init_dma(void);
873 int irq;
875 for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) {
876 *desc = bad_irq_desc;
877 INIT_LIST_HEAD(&desc->pend);
880 init_arch_irq();
881 init_dma();
884 static int __init noirqdebug_setup(char *str)
886 noirqdebug = 1;
887 return 1;
890 __setup("noirqdebug", noirqdebug_setup);