Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v2.6.37-rc1 159 lines 4.5 kB view raw
1#ifndef _LINUX_IRQDESC_H 2#define _LINUX_IRQDESC_H 3 4/* 5 * Core internal functions to deal with irq descriptors 6 * 7 * This include will move to kernel/irq once we cleaned up the tree. 8 * For now it's included from <linux/irq.h> 9 */ 10 11struct proc_dir_entry; 12struct timer_rand_state; 13/** 14 * struct irq_desc - interrupt descriptor 15 * @irq_data: per irq and chip data passed down to chip functions 16 * @timer_rand_state: pointer to timer rand state struct 17 * @kstat_irqs: irq stats per cpu 18 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] 19 * @action: the irq action chain 20 * @status: status information 21 * @depth: disable-depth, for nested irq_disable() calls 22 * @wake_depth: enable depth, for multiple set_irq_wake() callers 23 * @irq_count: stats field to detect stalled irqs 24 * @last_unhandled: aging timer for unhandled count 25 * @irqs_unhandled: stats field for spurious unhandled interrupts 26 * @lock: locking for SMP 27 * @pending_mask: pending rebalanced interrupts 28 * @threads_active: number of irqaction threads currently running 29 * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers 30 * @dir: /proc/irq/ procfs entry 31 * @name: flow handler name for /proc/interrupts output 32 */ 33struct irq_desc { 34 35#ifdef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED 36 struct irq_data irq_data; 37#else 38 /* 39 * This union will go away, once we fixed the direct access to 40 * irq_desc all over the place. The direct fields are a 1:1 41 * overlay of irq_data. 42 */ 43 union { 44 struct irq_data irq_data; 45 struct { 46 unsigned int irq; 47 unsigned int node; 48 struct irq_chip *chip; 49 void *handler_data; 50 void *chip_data; 51 struct msi_desc *msi_desc; 52#ifdef CONFIG_SMP 53 cpumask_var_t affinity; 54#endif 55 }; 56 }; 57#endif 58 59 struct timer_rand_state *timer_rand_state; 60 unsigned int *kstat_irqs; 61 irq_flow_handler_t handle_irq; 62 struct irqaction *action; /* IRQ action list */ 63 unsigned int status; /* IRQ status */ 64 65 unsigned int depth; /* nested irq disables */ 66 unsigned int wake_depth; /* nested wake enables */ 67 unsigned int irq_count; /* For detecting broken IRQs */ 68 unsigned long last_unhandled; /* Aging timer for unhandled count */ 69 unsigned int irqs_unhandled; 70 raw_spinlock_t lock; 71#ifdef CONFIG_SMP 72 const struct cpumask *affinity_hint; 73#ifdef CONFIG_GENERIC_PENDING_IRQ 74 cpumask_var_t pending_mask; 75#endif 76#endif 77 atomic_t threads_active; 78 wait_queue_head_t wait_for_threads; 79#ifdef CONFIG_PROC_FS 80 struct proc_dir_entry *dir; 81#endif 82 const char *name; 83} ____cacheline_internodealigned_in_smp; 84 85#ifndef CONFIG_SPARSE_IRQ 86extern struct irq_desc irq_desc[NR_IRQS]; 87#endif 88 89/* Will be removed once the last users in power and sh are gone */ 90extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); 91static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) 92{ 93 return desc; 94} 95 96#ifdef CONFIG_GENERIC_HARDIRQS 97 98#define get_irq_desc_chip(desc) ((desc)->irq_data.chip) 99#define get_irq_desc_chip_data(desc) ((desc)->irq_data.chip_data) 100#define get_irq_desc_data(desc) ((desc)->irq_data.handler_data) 101#define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc) 102 103/* 104 * Monolithic do_IRQ implementation. 105 */ 106#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 107extern unsigned int __do_IRQ(unsigned int irq); 108#endif 109 110/* 111 * Architectures call this to let the generic IRQ layer 112 * handle an interrupt. If the descriptor is attached to an 113 * irqchip-style controller then we call the ->handle_irq() handler, 114 * and it calls __do_IRQ() if it's attached to an irqtype-style controller. 115 */ 116static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc) 117{ 118#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 119 desc->handle_irq(irq, desc); 120#else 121 if (likely(desc->handle_irq)) 122 desc->handle_irq(irq, desc); 123 else 124 __do_IRQ(irq); 125#endif 126} 127 128static inline void generic_handle_irq(unsigned int irq) 129{ 130 generic_handle_irq_desc(irq, irq_to_desc(irq)); 131} 132 133/* Test to see if a driver has successfully requested an irq */ 134static inline int irq_has_action(unsigned int irq) 135{ 136 struct irq_desc *desc = irq_to_desc(irq); 137 return desc->action != NULL; 138} 139 140static inline int irq_balancing_disabled(unsigned int irq) 141{ 142 struct irq_desc *desc; 143 144 desc = irq_to_desc(irq); 145 return desc->status & IRQ_NO_BALANCING_MASK; 146} 147 148/* caller has locked the irq_desc and both params are valid */ 149static inline void __set_irq_handler_unlocked(int irq, 150 irq_flow_handler_t handler) 151{ 152 struct irq_desc *desc; 153 154 desc = irq_to_desc(irq); 155 desc->handle_irq = handler; 156} 157#endif 158 159#endif