aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/irq.h')
-rw-r--r--include/linux/irq.h48
1 files changed, 43 insertions, 5 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 3dddfa703ebd..f899b502f186 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -113,7 +113,8 @@ struct irq_chip {
113 void (*eoi)(unsigned int irq); 113 void (*eoi)(unsigned int irq);
114 114
115 void (*end)(unsigned int irq); 115 void (*end)(unsigned int irq);
116 void (*set_affinity)(unsigned int irq, cpumask_t dest); 116 void (*set_affinity)(unsigned int irq,
117 const struct cpumask *dest);
117 int (*retrigger)(unsigned int irq); 118 int (*retrigger)(unsigned int irq);
118 int (*set_type)(unsigned int irq, unsigned int flow_type); 119 int (*set_type)(unsigned int irq, unsigned int flow_type);
119 int (*set_wake)(unsigned int irq, unsigned int on); 120 int (*set_wake)(unsigned int irq, unsigned int on);
@@ -129,9 +130,14 @@ struct irq_chip {
129 const char *typename; 130 const char *typename;
130}; 131};
131 132
133struct timer_rand_state;
134struct irq_2_iommu;
132/** 135/**
133 * struct irq_desc - interrupt descriptor 136 * struct irq_desc - interrupt descriptor
134 * @irq: interrupt number for this descriptor 137 * @irq: interrupt number for this descriptor
138 * @timer_rand_state: pointer to timer rand state struct
139 * @kstat_irqs: irq stats per cpu
140 * @irq_2_iommu: iommu with this irq
135 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] 141 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()]
136 * @chip: low level interrupt hardware access 142 * @chip: low level interrupt hardware access
137 * @msi_desc: MSI descriptor 143 * @msi_desc: MSI descriptor
@@ -143,8 +149,8 @@ struct irq_chip {
143 * @depth: disable-depth, for nested irq_disable() calls 149 * @depth: disable-depth, for nested irq_disable() calls
144 * @wake_depth: enable depth, for multiple set_irq_wake() callers 150 * @wake_depth: enable depth, for multiple set_irq_wake() callers
145 * @irq_count: stats field to detect stalled irqs 151 * @irq_count: stats field to detect stalled irqs
146 * @irqs_unhandled: stats field for spurious unhandled interrupts
147 * @last_unhandled: aging timer for unhandled count 152 * @last_unhandled: aging timer for unhandled count
153 * @irqs_unhandled: stats field for spurious unhandled interrupts
148 * @lock: locking for SMP 154 * @lock: locking for SMP
149 * @affinity: IRQ affinity on SMP 155 * @affinity: IRQ affinity on SMP
150 * @cpu: cpu index useful for balancing 156 * @cpu: cpu index useful for balancing
@@ -154,6 +160,13 @@ struct irq_chip {
154 */ 160 */
155struct irq_desc { 161struct irq_desc {
156 unsigned int irq; 162 unsigned int irq;
163#ifdef CONFIG_SPARSE_IRQ
164 struct timer_rand_state *timer_rand_state;
165 unsigned int *kstat_irqs;
166# ifdef CONFIG_INTR_REMAP
167 struct irq_2_iommu *irq_2_iommu;
168# endif
169#endif
157 irq_flow_handler_t handle_irq; 170 irq_flow_handler_t handle_irq;
158 struct irq_chip *chip; 171 struct irq_chip *chip;
159 struct msi_desc *msi_desc; 172 struct msi_desc *msi_desc;
@@ -165,8 +178,8 @@ struct irq_desc {
165 unsigned int depth; /* nested irq disables */ 178 unsigned int depth; /* nested irq disables */
166 unsigned int wake_depth; /* nested wake enables */ 179 unsigned int wake_depth; /* nested wake enables */
167 unsigned int irq_count; /* For detecting broken IRQs */ 180 unsigned int irq_count; /* For detecting broken IRQs */
168 unsigned int irqs_unhandled;
169 unsigned long last_unhandled; /* Aging timer for unhandled count */ 181 unsigned long last_unhandled; /* Aging timer for unhandled count */
182 unsigned int irqs_unhandled;
170 spinlock_t lock; 183 spinlock_t lock;
171#ifdef CONFIG_SMP 184#ifdef CONFIG_SMP
172 cpumask_t affinity; 185 cpumask_t affinity;
@@ -181,12 +194,32 @@ struct irq_desc {
181 const char *name; 194 const char *name;
182} ____cacheline_internodealigned_in_smp; 195} ____cacheline_internodealigned_in_smp;
183 196
197extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
198 struct irq_desc *desc, int cpu);
199extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
184 200
201#ifndef CONFIG_SPARSE_IRQ
185extern struct irq_desc irq_desc[NR_IRQS]; 202extern struct irq_desc irq_desc[NR_IRQS];
203#else /* CONFIG_SPARSE_IRQ */
204extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
205
206#define kstat_irqs_this_cpu(DESC) \
207 ((DESC)->kstat_irqs[smp_processor_id()])
208#define kstat_incr_irqs_this_cpu(irqno, DESC) \
209 ((DESC)->kstat_irqs[smp_processor_id()]++)
186 210
187static inline struct irq_desc *irq_to_desc(unsigned int irq) 211#endif /* CONFIG_SPARSE_IRQ */
212
213extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
214
215static inline struct irq_desc *
216irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
188{ 217{
189 return (irq < nr_irqs) ? irq_desc + irq : NULL; 218#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
219 return irq_to_desc(irq);
220#else
221 return desc;
222#endif
190} 223}
191 224
192/* 225/*
@@ -380,6 +413,11 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
380#define get_irq_data(irq) (irq_to_desc(irq)->handler_data) 413#define get_irq_data(irq) (irq_to_desc(irq)->handler_data)
381#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc) 414#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc)
382 415
416#define get_irq_desc_chip(desc) ((desc)->chip)
417#define get_irq_desc_chip_data(desc) ((desc)->chip_data)
418#define get_irq_desc_data(desc) ((desc)->handler_data)
419#define get_irq_desc_msi(desc) ((desc)->msi_desc)
420
383#endif /* CONFIG_GENERIC_HARDIRQS */ 421#endif /* CONFIG_GENERIC_HARDIRQS */
384 422
385#endif /* !CONFIG_S390 */ 423#endif /* !CONFIG_S390 */