diff options
Diffstat (limited to 'include/linux/irqdesc.h')
| -rw-r--r-- | include/linux/irqdesc.h | 78 |
1 files changed, 73 insertions, 5 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index c1a95b7b58de..00218371518b 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * For now it's included from <linux/irq.h> | 8 | * For now it's included from <linux/irq.h> |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | struct irq_affinity_notify; | ||
| 11 | struct proc_dir_entry; | 12 | struct proc_dir_entry; |
| 12 | struct timer_rand_state; | 13 | struct timer_rand_state; |
| 13 | /** | 14 | /** |
| @@ -18,13 +19,16 @@ struct timer_rand_state; | |||
| 18 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] | 19 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] |
| 19 | * @action: the irq action chain | 20 | * @action: the irq action chain |
| 20 | * @status: status information | 21 | * @status: status information |
| 22 | * @core_internal_state__do_not_mess_with_it: core internal status information | ||
| 21 | * @depth: disable-depth, for nested irq_disable() calls | 23 | * @depth: disable-depth, for nested irq_disable() calls |
| 22 | * @wake_depth: enable depth, for multiple set_irq_wake() callers | 24 | * @wake_depth: enable depth, for multiple set_irq_wake() callers |
| 23 | * @irq_count: stats field to detect stalled irqs | 25 | * @irq_count: stats field to detect stalled irqs |
| 24 | * @last_unhandled: aging timer for unhandled count | 26 | * @last_unhandled: aging timer for unhandled count |
| 25 | * @irqs_unhandled: stats field for spurious unhandled interrupts | 27 | * @irqs_unhandled: stats field for spurious unhandled interrupts |
| 26 | * @lock: locking for SMP | 28 | * @lock: locking for SMP |
| 29 | * @affinity_notify: context for notification of affinity changes | ||
| 27 | * @pending_mask: pending rebalanced interrupts | 30 | * @pending_mask: pending rebalanced interrupts |
| 31 | * @threads_oneshot: bitfield to handle shared oneshot threads | ||
| 28 | * @threads_active: number of irqaction threads currently running | 32 | * @threads_active: number of irqaction threads currently running |
| 29 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers | 33 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers |
| 30 | * @dir: /proc/irq/ procfs entry | 34 | * @dir: /proc/irq/ procfs entry |
| @@ -45,6 +49,7 @@ struct irq_desc { | |||
| 45 | struct { | 49 | struct { |
| 46 | unsigned int irq; | 50 | unsigned int irq; |
| 47 | unsigned int node; | 51 | unsigned int node; |
| 52 | unsigned int pad_do_not_even_think_about_it; | ||
| 48 | struct irq_chip *chip; | 53 | struct irq_chip *chip; |
| 49 | void *handler_data; | 54 | void *handler_data; |
| 50 | void *chip_data; | 55 | void *chip_data; |
| @@ -59,9 +64,16 @@ struct irq_desc { | |||
| 59 | struct timer_rand_state *timer_rand_state; | 64 | struct timer_rand_state *timer_rand_state; |
| 60 | unsigned int __percpu *kstat_irqs; | 65 | unsigned int __percpu *kstat_irqs; |
| 61 | irq_flow_handler_t handle_irq; | 66 | irq_flow_handler_t handle_irq; |
| 67 | #ifdef CONFIG_IRQ_PREFLOW_FASTEOI | ||
| 68 | irq_preflow_handler_t preflow_handler; | ||
| 69 | #endif | ||
| 62 | struct irqaction *action; /* IRQ action list */ | 70 | struct irqaction *action; /* IRQ action list */ |
| 71 | #ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT | ||
| 72 | unsigned int status_use_accessors; | ||
| 73 | #else | ||
| 63 | unsigned int status; /* IRQ status */ | 74 | unsigned int status; /* IRQ status */ |
| 64 | 75 | #endif | |
| 76 | unsigned int core_internal_state__do_not_mess_with_it; | ||
| 65 | unsigned int depth; /* nested irq disables */ | 77 | unsigned int depth; /* nested irq disables */ |
| 66 | unsigned int wake_depth; /* nested wake enables */ | 78 | unsigned int wake_depth; /* nested wake enables */ |
| 67 | unsigned int irq_count; /* For detecting broken IRQs */ | 79 | unsigned int irq_count; /* For detecting broken IRQs */ |
| @@ -70,10 +82,12 @@ struct irq_desc { | |||
| 70 | raw_spinlock_t lock; | 82 | raw_spinlock_t lock; |
| 71 | #ifdef CONFIG_SMP | 83 | #ifdef CONFIG_SMP |
| 72 | const struct cpumask *affinity_hint; | 84 | const struct cpumask *affinity_hint; |
| 85 | struct irq_affinity_notify *affinity_notify; | ||
| 73 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 86 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
| 74 | cpumask_var_t pending_mask; | 87 | cpumask_var_t pending_mask; |
| 75 | #endif | 88 | #endif |
| 76 | #endif | 89 | #endif |
| 90 | unsigned long threads_oneshot; | ||
| 77 | atomic_t threads_active; | 91 | atomic_t threads_active; |
| 78 | wait_queue_head_t wait_for_threads; | 92 | wait_queue_head_t wait_for_threads; |
| 79 | #ifdef CONFIG_PROC_FS | 93 | #ifdef CONFIG_PROC_FS |
| @@ -95,10 +109,51 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | |||
| 95 | 109 | ||
| 96 | #ifdef CONFIG_GENERIC_HARDIRQS | 110 | #ifdef CONFIG_GENERIC_HARDIRQS |
| 97 | 111 | ||
| 98 | #define get_irq_desc_chip(desc) ((desc)->irq_data.chip) | 112 | static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc) |
| 99 | #define get_irq_desc_chip_data(desc) ((desc)->irq_data.chip_data) | 113 | { |
| 100 | #define get_irq_desc_data(desc) ((desc)->irq_data.handler_data) | 114 | return &desc->irq_data; |
| 101 | #define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc) | 115 | } |
| 116 | |||
| 117 | static inline struct irq_chip *irq_desc_get_chip(struct irq_desc *desc) | ||
| 118 | { | ||
| 119 | return desc->irq_data.chip; | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline void *irq_desc_get_chip_data(struct irq_desc *desc) | ||
| 123 | { | ||
| 124 | return desc->irq_data.chip_data; | ||
| 125 | } | ||
| 126 | |||
| 127 | static inline void *irq_desc_get_handler_data(struct irq_desc *desc) | ||
| 128 | { | ||
| 129 | return desc->irq_data.handler_data; | ||
| 130 | } | ||
| 131 | |||
| 132 | static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc) | ||
| 133 | { | ||
| 134 | return desc->irq_data.msi_desc; | ||
| 135 | } | ||
| 136 | |||
| 137 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT | ||
| 138 | static inline struct irq_chip *get_irq_desc_chip(struct irq_desc *desc) | ||
| 139 | { | ||
| 140 | return irq_desc_get_chip(desc); | ||
| 141 | } | ||
| 142 | static inline void *get_irq_desc_data(struct irq_desc *desc) | ||
| 143 | { | ||
| 144 | return irq_desc_get_handler_data(desc); | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline void *get_irq_desc_chip_data(struct irq_desc *desc) | ||
| 148 | { | ||
| 149 | return irq_desc_get_chip_data(desc); | ||
| 150 | } | ||
| 151 | |||
| 152 | static inline struct msi_desc *get_irq_desc_msi(struct irq_desc *desc) | ||
| 153 | { | ||
| 154 | return irq_desc_get_msi_desc(desc); | ||
| 155 | } | ||
| 156 | #endif | ||
| 102 | 157 | ||
| 103 | /* | 158 | /* |
| 104 | * Architectures call this to let the generic IRQ layer | 159 | * Architectures call this to let the generic IRQ layer |
| @@ -123,6 +178,7 @@ static inline int irq_has_action(unsigned int irq) | |||
| 123 | return desc->action != NULL; | 178 | return desc->action != NULL; |
| 124 | } | 179 | } |
| 125 | 180 | ||
| 181 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT | ||
| 126 | static inline int irq_balancing_disabled(unsigned int irq) | 182 | static inline int irq_balancing_disabled(unsigned int irq) |
| 127 | { | 183 | { |
| 128 | struct irq_desc *desc; | 184 | struct irq_desc *desc; |
| @@ -130,6 +186,7 @@ static inline int irq_balancing_disabled(unsigned int irq) | |||
| 130 | desc = irq_to_desc(irq); | 186 | desc = irq_to_desc(irq); |
| 131 | return desc->status & IRQ_NO_BALANCING_MASK; | 187 | return desc->status & IRQ_NO_BALANCING_MASK; |
| 132 | } | 188 | } |
| 189 | #endif | ||
| 133 | 190 | ||
| 134 | /* caller has locked the irq_desc and both params are valid */ | 191 | /* caller has locked the irq_desc and both params are valid */ |
| 135 | static inline void __set_irq_handler_unlocked(int irq, | 192 | static inline void __set_irq_handler_unlocked(int irq, |
| @@ -140,6 +197,17 @@ static inline void __set_irq_handler_unlocked(int irq, | |||
| 140 | desc = irq_to_desc(irq); | 197 | desc = irq_to_desc(irq); |
| 141 | desc->handle_irq = handler; | 198 | desc->handle_irq = handler; |
| 142 | } | 199 | } |
| 200 | |||
| 201 | #ifdef CONFIG_IRQ_PREFLOW_FASTEOI | ||
| 202 | static inline void | ||
| 203 | __irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler) | ||
| 204 | { | ||
| 205 | struct irq_desc *desc; | ||
| 206 | |||
| 207 | desc = irq_to_desc(irq); | ||
| 208 | desc->preflow_handler = handler; | ||
| 209 | } | ||
| 210 | #endif | ||
| 143 | #endif | 211 | #endif |
| 144 | 212 | ||
| 145 | #endif | 213 | #endif |
