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.h54
1 files changed, 53 insertions, 1 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 3dddfa703ebd..63b00439d4d2 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -129,6 +129,8 @@ struct irq_chip {
129 const char *typename; 129 const char *typename;
130}; 130};
131 131
132struct timer_rand_state;
133struct irq_2_iommu;
132/** 134/**
133 * struct irq_desc - interrupt descriptor 135 * struct irq_desc - interrupt descriptor
134 * @irq: interrupt number for this descriptor 136 * @irq: interrupt number for this descriptor
@@ -154,6 +156,13 @@ struct irq_chip {
154 */ 156 */
155struct irq_desc { 157struct irq_desc {
156 unsigned int irq; 158 unsigned int irq;
159#ifdef CONFIG_SPARSE_IRQ
160 struct timer_rand_state *timer_rand_state;
161 unsigned int *kstat_irqs;
162# ifdef CONFIG_INTR_REMAP
163 struct irq_2_iommu *irq_2_iommu;
164# endif
165#endif
157 irq_flow_handler_t handle_irq; 166 irq_flow_handler_t handle_irq;
158 struct irq_chip *chip; 167 struct irq_chip *chip;
159 struct msi_desc *msi_desc; 168 struct msi_desc *msi_desc;
@@ -181,14 +190,52 @@ struct irq_desc {
181 const char *name; 190 const char *name;
182} ____cacheline_internodealigned_in_smp; 191} ____cacheline_internodealigned_in_smp;
183 192
193extern void early_irq_init(void);
194extern void arch_early_irq_init(void);
195extern void arch_init_chip_data(struct irq_desc *desc, int cpu);
196extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
197 struct irq_desc *desc, int cpu);
198extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
199
200#ifndef CONFIG_SPARSE_IRQ
184 201
185extern struct irq_desc irq_desc[NR_IRQS]; 202extern struct irq_desc irq_desc[NR_IRQS];
186 203
187static inline struct irq_desc *irq_to_desc(unsigned int irq) 204static inline struct irq_desc *irq_to_desc(unsigned int irq)
188{ 205{
189 return (irq < nr_irqs) ? irq_desc + irq : NULL; 206 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
207}
208static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
209{
210 return irq_to_desc(irq);
190} 211}
191 212
213#ifdef CONFIG_GENERIC_HARDIRQS
214# define for_each_irq_desc(irq, desc) \
215 for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
216# define for_each_irq_desc_reverse(irq, desc) \
217 for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \
218 irq >= 0; irq--, desc--)
219#endif
220
221#else
222
223extern struct irq_desc *irq_to_desc(unsigned int irq);
224extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
225extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
226
227# define for_each_irq_desc(irq, desc) \
228 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq))
229# define for_each_irq_desc_reverse(irq, desc) \
230 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq))
231
232#define kstat_irqs_this_cpu(DESC) \
233 ((DESC)->kstat_irqs[smp_processor_id()])
234#define kstat_incr_irqs_this_cpu(irqno, DESC) \
235 ((DESC)->kstat_irqs[smp_processor_id()]++)
236
237#endif
238
192/* 239/*
193 * Migration helpers for obsolete names, they will go away: 240 * Migration helpers for obsolete names, they will go away:
194 */ 241 */
@@ -380,6 +427,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) 427#define get_irq_data(irq) (irq_to_desc(irq)->handler_data)
381#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc) 428#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc)
382 429
430#define get_irq_desc_chip(desc) ((desc)->chip)
431#define get_irq_desc_chip_data(desc) ((desc)->chip_data)
432#define get_irq_desc_data(desc) ((desc)->handler_data)
433#define get_irq_desc_msi(desc) ((desc)->msi_desc)
434
383#endif /* CONFIG_GENERIC_HARDIRQS */ 435#endif /* CONFIG_GENERIC_HARDIRQS */
384 436
385#endif /* !CONFIG_S390 */ 437#endif /* !CONFIG_S390 */