2 * linux/arch/i386/kernel/irq.c
4 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
6 * This file contains the code used by various IRQ handling routines:
7 * asking for different IRQ's should be done through these routines
8 * instead of just grabbing them. Thus setups with different IRQ numbers
9 * shouldn't result in any weird surprises, and installing new handlers
14 * (mostly architecture independent, will move to kernel/irq.c in 2.5.)
16 * IRQs are in fact implemented a bit like signal handlers for the kernel.
17 * Naturally it's not a 1:1 relation, but there are similarities.
20 #include <linux/config.h>
21 #include <linux/errno.h>
22 #include <linux/module.h>
23 #include <linux/signal.h>
24 #include <linux/sched.h>
25 #include <linux/ioport.h>
26 #include <linux/interrupt.h>
27 #include <linux/timex.h>
28 #include <linux/slab.h>
29 #include <linux/random.h>
30 #include <linux/smp_lock.h>
31 #include <linux/init.h>
32 #include <linux/kernel_stat.h>
33 #include <linux/irq.h>
34 #include <linux/proc_fs.h>
35 #include <linux/seq_file.h>
36 #include <linux/kallsyms.h>
38 #include <asm/atomic.h>
41 #include <asm/system.h>
42 #include <asm/bitops.h>
43 #include <asm/uaccess.h>
44 #include <asm/pgalloc.h>
45 #include <asm/delay.h>
50 * Linux has a controller-independent x86 interrupt architecture.
51 * every controller has a 'controller-template', that is used
52 * by the main code to do the right thing. Each driver-visible
53 * interrupt source is transparently wired to the apropriate
54 * controller. Thus drivers need not be aware of the
55 * interrupt-controller.
57 * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
58 * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
59 * (IO-APICs assumed to be messaging to Pentium local-APICs)
61 * the code is designed to be easily extended with new/different
62 * interrupt controllers, without having to do assembly magic.
66 * Controller mappings for all interrupt sources:
68 irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
70 .handler = &no_irq_type,
71 .lock = SPIN_LOCK_UNLOCKED
75 static void register_irq_proc (unsigned int irq);
78 * Special irq handlers.
81 irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs)
85 * Generic no controller code
88 static void enable_none(unsigned int irq) { }
89 static unsigned int startup_none(unsigned int irq) { return 0; }
90 static void disable_none(unsigned int irq) { }
91 static void ack_none(unsigned int irq)
94 * 'what should we do if we get a hw irq event on an illegal vector'.
95 * each architecture has to answer this themselves, it doesn't deserve
96 * a generic callback i think.
99 printk("unexpected IRQ trap at vector %02x\n", irq);
100 #ifdef CONFIG_X86_LOCAL_APIC
102 * Currently unexpected vectors happen only on SMP and APIC.
103 * We _must_ ack these because every local APIC has only N
104 * irq slots per priority level, and a 'hanging, unacked' IRQ
105 * holds up an irq slot - in excessive cases (when multiple
106 * unexpected vectors occur) that might lock up the APIC
114 /* startup is the same as "enable", shutdown is same as "disable" */
115 #define shutdown_none disable_none
116 #define end_none enable_none
118 struct hw_interrupt_type no_irq_type = {
128 atomic_t irq_err_count;
129 #ifdef CONFIG_X86_IO_APIC
130 #ifdef APIC_MISMATCH_DEBUG
131 atomic_t irq_mis_count;
136 * Generic, controller-independent functions:
139 int show_interrupts(struct seq_file *p, void *v)
141 int i = *(loff_t *) v, j;
142 struct irqaction * action;
147 for (j=0; j<NR_CPUS; j++)
149 seq_printf(p, "CPU%d ",j);
154 spin_lock_irqsave(&irq_desc[i].lock, flags);
155 action = irq_desc[i].action;
158 seq_printf(p, "%3d: ",i);
160 seq_printf(p, "%10u ", kstat_irqs(i));
162 for (j = 0; j < NR_CPUS; j++)
164 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
166 seq_printf(p, " %14s", irq_desc[i].handler->typename);
167 seq_printf(p, " %s", action->name);
169 for (action=action->next; action; action = action->next)
170 seq_printf(p, ", %s", action->name);
174 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
175 } else if (i == NR_IRQS) {
176 seq_printf(p, "NMI: ");
177 for (j = 0; j < NR_CPUS; j++)
179 seq_printf(p, "%10u ", nmi_count(j));
181 #ifdef CONFIG_X86_LOCAL_APIC
182 seq_printf(p, "LOC: ");
183 for (j = 0; j < NR_CPUS; j++)
185 seq_printf(p, "%10u ", irq_stat[j].apic_timer_irqs);
188 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
189 #ifdef CONFIG_X86_IO_APIC
190 #ifdef APIC_MISMATCH_DEBUG
191 seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
202 inline void synchronize_irq(unsigned int irq)
204 while (irq_desc[irq].status & IRQ_INPROGRESS)
210 * This should really return information about whether
211 * we should do bottom half handling etc. Right now we
212 * end up _always_ checking the bottom half, which is a
213 * waste of time and is not what some drivers would
216 int handle_IRQ_event(unsigned int irq,
217 struct pt_regs *regs, struct irqaction *action)
219 int status = 1; /* Force the "do bottom halves" bit */
222 if (!(action->flags & SA_INTERRUPT))
226 status |= action->flags;
227 retval |= action->handler(irq, action->dev_id, regs);
228 action = action->next;
230 if (status & SA_SAMPLE_RANDOM)
231 add_interrupt_randomness(irq);
236 static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret)
238 struct irqaction *action;
240 if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) {
241 printk(KERN_ERR "irq event %d: bogus return value %x\n",
244 printk(KERN_ERR "irq %d: nobody cared!\n", irq);
247 printk(KERN_ERR "handlers:\n");
248 action = desc->action;
250 printk(KERN_ERR "[<%p>]", action->handler);
251 print_symbol(" (%s)",
252 (unsigned long)action->handler);
254 action = action->next;
258 static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret)
260 static int count = 100;
264 __report_bad_irq(irq, desc, action_ret);
268 static int noirqdebug;
270 static int __init noirqdebug_setup(char *str)
273 printk("IRQ lockup detection disabled\n");
277 __setup("noirqdebug", noirqdebug_setup);
280 * If 99,900 of the previous 100,000 interrupts have not been handled then
281 * assume that the IRQ is stuck in some manner. Drop a diagnostic and try to
284 * (The other 100-of-100,000 interrupts may have been a correctly-functioning
285 * device sharing an IRQ with the failing one)
287 * Called under desc->lock
289 static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret)
291 if (action_ret != IRQ_HANDLED) {
292 desc->irqs_unhandled++;
293 if (action_ret != IRQ_NONE)
294 report_bad_irq(irq, desc, action_ret);
298 if (desc->irq_count < 100000)
302 if (desc->irqs_unhandled > 99900) {
304 * The interrupt is stuck
306 __report_bad_irq(irq, desc, action_ret);
310 printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
311 desc->status |= IRQ_DISABLED;
312 desc->handler->disable(irq);
314 desc->irqs_unhandled = 0;
318 * Generic enable/disable code: this just calls
319 * down into the PIC-specific version for the actual
320 * hardware disable after having gotten the irq
325 * disable_irq_nosync - disable an irq without waiting
326 * @irq: Interrupt to disable
328 * Disable the selected interrupt line. Disables and Enables are
330 * Unlike disable_irq(), this function does not ensure existing
331 * instances of the IRQ handler have completed before returning.
333 * This function may be called from IRQ context.
336 inline void disable_irq_nosync(unsigned int irq)
338 irq_desc_t *desc = irq_desc + irq;
341 spin_lock_irqsave(&desc->lock, flags);
342 if (!desc->depth++) {
343 desc->status |= IRQ_DISABLED;
344 desc->handler->disable(irq);
346 spin_unlock_irqrestore(&desc->lock, flags);
350 * disable_irq - disable an irq and wait for completion
351 * @irq: Interrupt to disable
353 * Disable the selected interrupt line. Enables and Disables are
355 * This function waits for any pending IRQ handlers for this interrupt
356 * to complete before returning. If you use this function while
357 * holding a resource the IRQ handler may need you will deadlock.
359 * This function may be called - with care - from IRQ context.
362 void disable_irq(unsigned int irq)
364 irq_desc_t *desc = irq_desc + irq;
365 disable_irq_nosync(irq);
367 synchronize_irq(irq);
371 * enable_irq - enable handling of an irq
372 * @irq: Interrupt to enable
374 * Undoes the effect of one call to disable_irq(). If this
375 * matches the last disable, processing of interrupts on this
376 * IRQ line is re-enabled.
378 * This function may be called from IRQ context.
381 void enable_irq(unsigned int irq)
383 irq_desc_t *desc = irq_desc + irq;
386 spin_lock_irqsave(&desc->lock, flags);
387 switch (desc->depth) {
389 unsigned int status = desc->status & ~IRQ_DISABLED;
390 desc->status = status;
391 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
392 desc->status = status | IRQ_REPLAY;
393 hw_resend_irq(desc->handler,irq);
395 desc->handler->enable(irq);
402 printk("enable_irq(%u) unbalanced from %p\n", irq,
403 __builtin_return_address(0));
405 spin_unlock_irqrestore(&desc->lock, flags);
409 * do_IRQ handles all normal device IRQ's (the special
410 * SMP cross-CPU interrupts have their own specific
413 asmlinkage unsigned int do_IRQ(struct pt_regs regs)
416 * We ack quickly, we don't want the irq controller
417 * thinking we're snobs just because some other CPU has
418 * disabled global interrupts (we have already done the
419 * INT_ACK cycles, it's too late to try to pretend to the
420 * controller that we aren't taking the interrupt).
422 * 0 return value means that this irq is already being
423 * handled by some other CPU. (or is disabled)
425 int irq = regs.orig_eax & 0xff; /* high bits used in ret_from_ code */
426 irq_desc_t *desc = irq_desc + irq;
427 struct irqaction * action;
432 #ifdef CONFIG_DEBUG_STACKOVERFLOW
433 /* Debugging check for stack overflow: is there less than 1KB free? */
437 __asm__ __volatile__("andl %%esp,%0" :
438 "=r" (esp) : "0" (THREAD_SIZE - 1));
439 if (unlikely(esp < (sizeof(struct thread_info) + 1024))) {
440 printk("do_IRQ: stack overflow: %ld\n",
441 esp - sizeof(struct thread_info));
446 kstat_this_cpu.irqs[irq]++;
447 spin_lock(&desc->lock);
448 desc->handler->ack(irq);
450 REPLAY is when Linux resends an IRQ that was dropped earlier
451 WAITING is used by probe to mark irqs that are being tested
453 status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
454 status |= IRQ_PENDING; /* we _want_ to handle it */
457 * If the IRQ is disabled for whatever reason, we cannot
458 * use the action we have.
461 if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) {
462 action = desc->action;
463 status &= ~IRQ_PENDING; /* we commit to handling */
464 status |= IRQ_INPROGRESS; /* we are handling it */
466 desc->status = status;
469 * If there is no IRQ handler or it was disabled, exit early.
470 Since we set PENDING, if another processor is handling
471 a different instance of this same irq, the other processor
472 will take care of it.
474 if (unlikely(!action))
478 * Edge triggered interrupts need to remember
480 * This applies to any hw interrupts that allow a second
481 * instance of the same irq to arrive while we are in do_IRQ
482 * or in the handler. But the code here only handles the _second_
483 * instance of the irq, not the third or fourth. So it is mostly
484 * useful for irq hardware that does not mask cleanly in an
488 irqreturn_t action_ret;
490 spin_unlock(&desc->lock);
491 action_ret = handle_IRQ_event(irq, ®s, action);
492 spin_lock(&desc->lock);
494 note_interrupt(irq, desc, action_ret);
495 if (likely(!(desc->status & IRQ_PENDING)))
497 desc->status &= ~IRQ_PENDING;
499 desc->status &= ~IRQ_INPROGRESS;
503 * The ->end() handler has to deal with interrupts which got
504 * disabled while the handler was running.
506 desc->handler->end(irq);
507 spin_unlock(&desc->lock);
514 int can_request_irq(unsigned int irq, unsigned long irqflags)
516 struct irqaction *action;
520 action = irq_desc[irq].action;
522 if (irqflags & action->flags & SA_SHIRQ)
529 * request_irq - allocate an interrupt line
530 * @irq: Interrupt line to allocate
531 * @handler: Function to be called when the IRQ occurs
532 * @irqflags: Interrupt type flags
533 * @devname: An ascii name for the claiming device
534 * @dev_id: A cookie passed back to the handler function
536 * This call allocates interrupt resources and enables the
537 * interrupt line and IRQ handling. From the point this
538 * call is made your handler function may be invoked. Since
539 * your handler function must clear any interrupt the board
540 * raises, you must take care both to initialise your hardware
541 * and to set up the interrupt handler in the right order.
543 * Dev_id must be globally unique. Normally the address of the
544 * device data structure is used as the cookie. Since the handler
545 * receives this value it makes sense to use it.
547 * If your interrupt is shared you must pass a non NULL dev_id
548 * as this is required when freeing the interrupt.
552 * SA_SHIRQ Interrupt is shared
554 * SA_INTERRUPT Disable local interrupts while processing
556 * SA_SAMPLE_RANDOM The interrupt can be used for entropy
560 int request_irq(unsigned int irq,
561 irqreturn_t (*handler)(int, void *, struct pt_regs *),
562 unsigned long irqflags,
563 const char * devname,
567 struct irqaction * action;
571 * Sanity-check: shared interrupts should REALLY pass in
572 * a real dev-ID, otherwise we'll have trouble later trying
573 * to figure out which interrupt is which (messes up the
574 * interrupt freeing logic etc).
576 if (irqflags & SA_SHIRQ) {
578 printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]);
587 action = (struct irqaction *)
588 kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
592 action->handler = handler;
593 action->flags = irqflags;
595 action->name = devname;
597 action->dev_id = dev_id;
599 retval = setup_irq(irq, action);
605 EXPORT_SYMBOL(request_irq);
608 * free_irq - free an interrupt
609 * @irq: Interrupt line to free
610 * @dev_id: Device identity to free
612 * Remove an interrupt handler. The handler is removed and if the
613 * interrupt line is no longer in use by any driver it is disabled.
614 * On a shared IRQ the caller must ensure the interrupt is disabled
615 * on the card it drives before calling this function. The function
616 * does not return until any executing interrupts for this IRQ
619 * This function must not be called from interrupt context.
622 void free_irq(unsigned int irq, void *dev_id)
625 struct irqaction **p;
631 desc = irq_desc + irq;
632 spin_lock_irqsave(&desc->lock,flags);
635 struct irqaction * action = *p;
637 struct irqaction **pp = p;
639 if (action->dev_id != dev_id)
642 /* Found it - now remove it from the list of entries */
645 desc->status |= IRQ_DISABLED;
646 desc->handler->shutdown(irq);
648 spin_unlock_irqrestore(&desc->lock,flags);
650 /* Wait to make sure it's not being used on another CPU */
651 synchronize_irq(irq);
655 printk("Trying to free free IRQ%d\n",irq);
656 spin_unlock_irqrestore(&desc->lock,flags);
661 EXPORT_SYMBOL(free_irq);
664 * IRQ autodetection code..
666 * This depends on the fact that any interrupt that
667 * comes in on to an unassigned handler will get stuck
668 * with "IRQ_WAITING" cleared and the interrupt
672 static DECLARE_MUTEX(probe_sem);
675 * probe_irq_on - begin an interrupt autodetect
677 * Commence probing for an interrupt. The interrupts are scanned
678 * and a mask of potential interrupt lines is returned.
682 unsigned long probe_irq_on(void)
691 * something may have generated an irq long ago and we want to
692 * flush such a longstanding irq before considering it as spurious.
694 for (i = NR_IRQS-1; i > 0; i--) {
697 spin_lock_irq(&desc->lock);
698 if (!irq_desc[i].action)
699 irq_desc[i].handler->startup(i);
700 spin_unlock_irq(&desc->lock);
703 /* Wait for longstanding interrupts to trigger. */
704 for (delay = jiffies + HZ/50; time_after(delay, jiffies); )
705 /* about 20ms delay */ barrier();
708 * enable any unassigned irqs
709 * (we must startup again here because if a longstanding irq
710 * happened in the previous stage, it may have masked itself)
712 for (i = NR_IRQS-1; i > 0; i--) {
715 spin_lock_irq(&desc->lock);
717 desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
718 if (desc->handler->startup(i))
719 desc->status |= IRQ_PENDING;
721 spin_unlock_irq(&desc->lock);
725 * Wait for spurious interrupts to trigger
727 for (delay = jiffies + HZ/10; time_after(delay, jiffies); )
728 /* about 100ms delay */ barrier();
731 * Now filter out any obviously spurious interrupts
734 for (i = 0; i < NR_IRQS; i++) {
735 irq_desc_t *desc = irq_desc + i;
738 spin_lock_irq(&desc->lock);
739 status = desc->status;
741 if (status & IRQ_AUTODETECT) {
742 /* It triggered already - consider it spurious. */
743 if (!(status & IRQ_WAITING)) {
744 desc->status = status & ~IRQ_AUTODETECT;
745 desc->handler->shutdown(i);
750 spin_unlock_irq(&desc->lock);
756 EXPORT_SYMBOL(probe_irq_on);
759 * Return a mask of triggered interrupts (this
760 * can handle only legacy ISA interrupts).
764 * probe_irq_mask - scan a bitmap of interrupt lines
765 * @val: mask of interrupts to consider
767 * Scan the ISA bus interrupt lines and return a bitmap of
768 * active interrupts. The interrupt probe logic state is then
769 * returned to its previous value.
771 * Note: we need to scan all the irq's even though we will
772 * only return ISA irq numbers - just so that we reset them
773 * all to a known state.
775 unsigned int probe_irq_mask(unsigned long val)
781 for (i = 0; i < NR_IRQS; i++) {
782 irq_desc_t *desc = irq_desc + i;
785 spin_lock_irq(&desc->lock);
786 status = desc->status;
788 if (status & IRQ_AUTODETECT) {
789 if (i < 16 && !(status & IRQ_WAITING))
792 desc->status = status & ~IRQ_AUTODETECT;
793 desc->handler->shutdown(i);
795 spin_unlock_irq(&desc->lock);
803 * Return the one interrupt that triggered (this can
804 * handle any interrupt source).
808 * probe_irq_off - end an interrupt autodetect
809 * @val: mask of potential interrupts (unused)
811 * Scans the unused interrupt lines and returns the line which
812 * appears to have triggered the interrupt. If no interrupt was
813 * found then zero is returned. If more than one interrupt is
814 * found then minus the first candidate is returned to indicate
817 * The interrupt probe logic state is returned to its previous
820 * BUGS: When used in a module (which arguably shouldnt happen)
821 * nothing prevents two IRQ probe callers from overlapping. The
822 * results of this are non-optimal.
825 int probe_irq_off(unsigned long val)
827 int i, irq_found, nr_irqs;
831 for (i = 0; i < NR_IRQS; i++) {
832 irq_desc_t *desc = irq_desc + i;
835 spin_lock_irq(&desc->lock);
836 status = desc->status;
838 if (status & IRQ_AUTODETECT) {
839 if (!(status & IRQ_WAITING)) {
844 desc->status = status & ~IRQ_AUTODETECT;
845 desc->handler->shutdown(i);
847 spin_unlock_irq(&desc->lock);
852 irq_found = -irq_found;
856 EXPORT_SYMBOL(probe_irq_off);
858 /* this was setup_x86_irq but it seems pretty generic */
859 int setup_irq(unsigned int irq, struct irqaction * new)
863 struct irqaction *old, **p;
864 irq_desc_t *desc = irq_desc + irq;
866 if (desc->handler == &no_irq_type)
869 * Some drivers like serial.c use request_irq() heavily,
870 * so we have to be careful not to interfere with a
873 if (new->flags & SA_SAMPLE_RANDOM) {
875 * This function might sleep, we want to call it first,
876 * outside of the atomic block.
877 * Yes, this might clear the entropy pool if the wrong
878 * driver is attempted to be loaded, without actually
879 * installing a new handler, but is this really a problem,
880 * only the sysadmin is able to do this.
882 rand_initialize_irq(irq);
886 * The following block of code has to be executed atomically
888 spin_lock_irqsave(&desc->lock,flags);
890 if ((old = *p) != NULL) {
891 /* Can't share interrupts unless both agree to */
892 if (!(old->flags & new->flags & SA_SHIRQ)) {
893 spin_unlock_irqrestore(&desc->lock,flags);
897 /* add new interrupt at end of irq queue */
909 desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
910 desc->handler->startup(irq);
912 spin_unlock_irqrestore(&desc->lock,flags);
914 register_irq_proc(irq);
918 static struct proc_dir_entry * root_irq_dir;
919 static struct proc_dir_entry * irq_dir [NR_IRQS];
923 static struct proc_dir_entry *smp_affinity_entry[NR_IRQS];
925 cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
927 static int irq_affinity_read_proc(char *page, char **start, off_t off,
928 int count, int *eof, void *data)
930 int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
933 len += sprintf(page + len, "\n");
937 static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
938 unsigned long count, void *data)
940 int irq = (long)data, full_count = count, err;
941 cpumask_t new_value, tmp;
943 if (!irq_desc[irq].handler->set_affinity)
946 err = cpumask_parse(buffer, count, new_value);
951 * Do not allow disabling IRQs completely - it's a too easy
952 * way to make the system unusable accidentally :-) At least
953 * one online CPU still has to be targeted.
955 cpus_and(tmp, new_value, cpu_online_map);
959 irq_affinity[irq] = new_value;
960 irq_desc[irq].handler->set_affinity(irq,
961 cpumask_of_cpu(first_cpu(new_value)));
968 static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
969 int count, int *eof, void *data)
971 int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
974 len += sprintf(page + len, "\n");
978 static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
979 unsigned long count, void *data)
981 cpumask_t *mask = (cpumask_t *)data;
982 unsigned long full_count = count, err;
985 err = cpumask_parse(buffer, count, new_value);
993 #define MAX_NAMELEN 10
995 static void register_irq_proc (unsigned int irq)
997 char name [MAX_NAMELEN];
999 if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
1003 memset(name, 0, MAX_NAMELEN);
1004 sprintf(name, "%d", irq);
1006 /* create /proc/irq/1234 */
1007 irq_dir[irq] = proc_mkdir(name, root_irq_dir);
1011 struct proc_dir_entry *entry;
1013 /* create /proc/irq/1234/smp_affinity */
1014 entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
1018 entry->data = (void *)(long)irq;
1019 entry->read_proc = irq_affinity_read_proc;
1020 entry->write_proc = irq_affinity_write_proc;
1023 smp_affinity_entry[irq] = entry;
1028 unsigned long prof_cpu_mask = -1;
1030 void init_irq_proc (void)
1032 struct proc_dir_entry *entry;
1035 /* create /proc/irq */
1036 root_irq_dir = proc_mkdir("irq", 0);
1038 /* create /proc/irq/prof_cpu_mask */
1039 entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
1045 entry->data = (void *)&prof_cpu_mask;
1046 entry->read_proc = prof_cpu_mask_read_proc;
1047 entry->write_proc = prof_cpu_mask_write_proc;
1050 * Create entries for all existing IRQs.
1052 for (i = 0; i < NR_IRQS; i++)
1053 register_irq_proc(i);