ocfs2: Make the left masklogs compat.
[taoma-kernel.git] / kernel / irq / internals.h
blob99c3bc8a6fb464f1e19a00dc6e1959cb9e777b5e
1 /*
2 * IRQ subsystem internal functions and variables:
3 */
4 #include <linux/irqdesc.h>
6 #ifdef CONFIG_SPARSE_IRQ
7 # define IRQ_BITMAP_BITS (NR_IRQS + 8196)
8 #else
9 # define IRQ_BITMAP_BITS NR_IRQS
10 #endif
12 extern int noirqdebug;
14 #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
16 /* Set default functions for irq_chip structures: */
17 extern void irq_chip_set_defaults(struct irq_chip *chip);
19 /* Set default handler: */
20 extern void compat_irq_chip_set_default_handler(struct irq_desc *desc);
22 extern int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
23 unsigned long flags);
24 extern void __disable_irq(struct irq_desc *desc, unsigned int irq, bool susp);
25 extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume);
27 extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr);
29 /* Resending of interrupts :*/
30 void check_irq_resend(struct irq_desc *desc, unsigned int irq);
32 #ifdef CONFIG_PROC_FS
33 extern void register_irq_proc(unsigned int irq, struct irq_desc *desc);
34 extern void unregister_irq_proc(unsigned int irq, struct irq_desc *desc);
35 extern void register_handler_proc(unsigned int irq, struct irqaction *action);
36 extern void unregister_handler_proc(unsigned int irq, struct irqaction *action);
37 #else
38 static inline void register_irq_proc(unsigned int irq, struct irq_desc *desc) { }
39 static inline void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) { }
40 static inline void register_handler_proc(unsigned int irq,
41 struct irqaction *action) { }
42 static inline void unregister_handler_proc(unsigned int irq,
43 struct irqaction *action) { }
44 #endif
46 extern int irq_select_affinity_usr(unsigned int irq);
48 extern void irq_set_thread_affinity(struct irq_desc *desc);
50 #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
51 static inline void irq_end(unsigned int irq, struct irq_desc *desc)
53 if (desc->irq_data.chip && desc->irq_data.chip->end)
54 desc->irq_data.chip->end(irq);
56 #else
57 static inline void irq_end(unsigned int irq, struct irq_desc *desc) { }
58 #endif
60 /* Inline functions for support of irq chips on slow busses */
61 static inline void chip_bus_lock(struct irq_desc *desc)
63 if (unlikely(desc->irq_data.chip->irq_bus_lock))
64 desc->irq_data.chip->irq_bus_lock(&desc->irq_data);
67 static inline void chip_bus_sync_unlock(struct irq_desc *desc)
69 if (unlikely(desc->irq_data.chip->irq_bus_sync_unlock))
70 desc->irq_data.chip->irq_bus_sync_unlock(&desc->irq_data);
74 * Debugging printout:
77 #include <linux/kallsyms.h>
79 #define P(f) if (desc->status & f) printk("%14s set\n", #f)
81 static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
83 printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
84 irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
85 printk("->handle_irq(): %p, ", desc->handle_irq);
86 print_symbol("%s\n", (unsigned long)desc->handle_irq);
87 printk("->irq_data.chip(): %p, ", desc->irq_data.chip);
88 print_symbol("%s\n", (unsigned long)desc->irq_data.chip);
89 printk("->action(): %p\n", desc->action);
90 if (desc->action) {
91 printk("->action->handler(): %p, ", desc->action->handler);
92 print_symbol("%s\n", (unsigned long)desc->action->handler);
95 P(IRQ_INPROGRESS);
96 P(IRQ_DISABLED);
97 P(IRQ_PENDING);
98 P(IRQ_REPLAY);
99 P(IRQ_AUTODETECT);
100 P(IRQ_WAITING);
101 P(IRQ_LEVEL);
102 P(IRQ_MASKED);
103 #ifdef CONFIG_IRQ_PER_CPU
104 P(IRQ_PER_CPU);
105 #endif
106 P(IRQ_NOPROBE);
107 P(IRQ_NOREQUEST);
108 P(IRQ_NOAUTOEN);
111 #undef P