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.h56
1 files changed, 47 insertions, 9 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index d058c57be02d..b5749db3e5a1 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -63,7 +63,8 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
63#define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */ 63#define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */
64#define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */ 64#define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */
65#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ 65#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */
66#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ 66#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
67#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/
67 68
68#ifdef CONFIG_IRQ_PER_CPU 69#ifdef CONFIG_IRQ_PER_CPU
69# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 70# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
@@ -128,9 +129,11 @@ struct irq_chip {
128 const char *typename; 129 const char *typename;
129}; 130};
130 131
132struct timer_rand_state;
133struct irq_2_iommu;
131/** 134/**
132 * struct irq_desc - interrupt descriptor 135 * struct irq_desc - interrupt descriptor
133 * 136 * @irq: interrupt number for this descriptor
134 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] 137 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()]
135 * @chip: low level interrupt hardware access 138 * @chip: low level interrupt hardware access
136 * @msi_desc: MSI descriptor 139 * @msi_desc: MSI descriptor
@@ -149,11 +152,17 @@ struct irq_chip {
149 * @cpu: cpu index useful for balancing 152 * @cpu: cpu index useful for balancing
150 * @pending_mask: pending rebalanced interrupts 153 * @pending_mask: pending rebalanced interrupts
151 * @dir: /proc/irq/ procfs entry 154 * @dir: /proc/irq/ procfs entry
152 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP
153 * @name: flow handler name for /proc/interrupts output 155 * @name: flow handler name for /proc/interrupts output
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,43 @@ 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);
184 199
200#ifndef CONFIG_SPARSE_IRQ
185extern struct irq_desc irq_desc[NR_IRQS]; 201extern struct irq_desc irq_desc[NR_IRQS];
186 202
187static inline struct irq_desc *irq_to_desc(unsigned int irq) 203static inline struct irq_desc *irq_to_desc(unsigned int irq)
188{ 204{
189 return (irq < nr_irqs) ? irq_desc + irq : NULL; 205 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
206}
207static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
208{
209 return irq_to_desc(irq);
190} 210}
191 211
212#else
213
214extern struct irq_desc *irq_to_desc(unsigned int irq);
215extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
216extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
217
218# define for_each_irq_desc(irq, desc) \
219 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq))
220# define for_each_irq_desc_reverse(irq, desc) \
221 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq))
222
223#define kstat_irqs_this_cpu(DESC) \
224 ((DESC)->kstat_irqs[smp_processor_id()])
225#define kstat_incr_irqs_this_cpu(irqno, DESC) \
226 ((DESC)->kstat_irqs[smp_processor_id()]++)
227
228#endif
229
192/* 230/*
193 * Migration helpers for obsolete names, they will go away: 231 * Migration helpers for obsolete names, they will go away:
194 */ 232 */
@@ -210,7 +248,6 @@ extern int setup_irq(unsigned int irq, struct irqaction *new);
210 248
211#ifdef CONFIG_GENERIC_PENDING_IRQ 249#ifdef CONFIG_GENERIC_PENDING_IRQ
212 250
213void set_pending_irq(unsigned int irq, cpumask_t mask);
214void move_native_irq(int irq); 251void move_native_irq(int irq);
215void move_masked_irq(int irq); 252void move_masked_irq(int irq);
216 253
@@ -228,10 +265,6 @@ static inline void move_masked_irq(int irq)
228{ 265{
229} 266}
230 267
231static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
232{
233}
234
235#endif /* CONFIG_GENERIC_PENDING_IRQ */ 268#endif /* CONFIG_GENERIC_PENDING_IRQ */
236 269
237#else /* CONFIG_SMP */ 270#else /* CONFIG_SMP */
@@ -385,6 +418,11 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
385#define get_irq_data(irq) (irq_to_desc(irq)->handler_data) 418#define get_irq_data(irq) (irq_to_desc(irq)->handler_data)
386#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc) 419#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc)
387 420
421#define get_irq_desc_chip(desc) ((desc)->chip)
422#define get_irq_desc_chip_data(desc) ((desc)->chip_data)
423#define get_irq_desc_data(desc) ((desc)->handler_data)
424#define get_irq_desc_msi(desc) ((desc)->msi_desc)
425
388#endif /* CONFIG_GENERIC_HARDIRQS */ 426#endif /* CONFIG_GENERIC_HARDIRQS */
389 427
390#endif /* !CONFIG_S390 */ 428#endif /* !CONFIG_S390 */