aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irqdesc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/irqdesc.h')
-rw-r--r--include/linux/irqdesc.h89
1 files changed, 26 insertions, 63 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 00218371518b..a082905b5ebe 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -35,32 +35,7 @@ struct timer_rand_state;
35 * @name: flow handler name for /proc/interrupts output 35 * @name: flow handler name for /proc/interrupts output
36 */ 36 */
37struct irq_desc { 37struct irq_desc {
38
39#ifdef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
40 struct irq_data irq_data; 38 struct irq_data irq_data;
41#else
42 /*
43 * This union will go away, once we fixed the direct access to
44 * irq_desc all over the place. The direct fields are a 1:1
45 * overlay of irq_data.
46 */
47 union {
48 struct irq_data irq_data;
49 struct {
50 unsigned int irq;
51 unsigned int node;
52 unsigned int pad_do_not_even_think_about_it;
53 struct irq_chip *chip;
54 void *handler_data;
55 void *chip_data;
56 struct msi_desc *msi_desc;
57#ifdef CONFIG_SMP
58 cpumask_var_t affinity;
59#endif
60 };
61 };
62#endif
63
64 struct timer_rand_state *timer_rand_state; 39 struct timer_rand_state *timer_rand_state;
65 unsigned int __percpu *kstat_irqs; 40 unsigned int __percpu *kstat_irqs;
66 irq_flow_handler_t handle_irq; 41 irq_flow_handler_t handle_irq;
@@ -68,11 +43,7 @@ struct irq_desc {
68 irq_preflow_handler_t preflow_handler; 43 irq_preflow_handler_t preflow_handler;
69#endif 44#endif
70 struct irqaction *action; /* IRQ action list */ 45 struct irqaction *action; /* IRQ action list */
71#ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
72 unsigned int status_use_accessors; 46 unsigned int status_use_accessors;
73#else
74 unsigned int status; /* IRQ status */
75#endif
76 unsigned int core_internal_state__do_not_mess_with_it; 47 unsigned int core_internal_state__do_not_mess_with_it;
77 unsigned int depth; /* nested irq disables */ 48 unsigned int depth; /* nested irq disables */
78 unsigned int wake_depth; /* nested wake enables */ 49 unsigned int wake_depth; /* nested wake enables */
@@ -100,13 +71,6 @@ struct irq_desc {
100extern struct irq_desc irq_desc[NR_IRQS]; 71extern struct irq_desc irq_desc[NR_IRQS];
101#endif 72#endif
102 73
103/* Will be removed once the last users in power and sh are gone */
104extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
105static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
106{
107 return desc;
108}
109
110#ifdef CONFIG_GENERIC_HARDIRQS 74#ifdef CONFIG_GENERIC_HARDIRQS
111 75
112static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc) 76static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc)
@@ -134,27 +98,6 @@ static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
134 return desc->irq_data.msi_desc; 98 return desc->irq_data.msi_desc;
135} 99}
136 100
137#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
138static inline struct irq_chip *get_irq_desc_chip(struct irq_desc *desc)
139{
140 return irq_desc_get_chip(desc);
141}
142static inline void *get_irq_desc_data(struct irq_desc *desc)
143{
144 return irq_desc_get_handler_data(desc);
145}
146
147static inline void *get_irq_desc_chip_data(struct irq_desc *desc)
148{
149 return irq_desc_get_chip_data(desc);
150}
151
152static inline struct msi_desc *get_irq_desc_msi(struct irq_desc *desc)
153{
154 return irq_desc_get_msi_desc(desc);
155}
156#endif
157
158/* 101/*
159 * Architectures call this to let the generic IRQ layer 102 * Architectures call this to let the generic IRQ layer
160 * handle an interrupt. If the descriptor is attached to an 103 * handle an interrupt. If the descriptor is attached to an
@@ -178,24 +121,44 @@ static inline int irq_has_action(unsigned int irq)
178 return desc->action != NULL; 121 return desc->action != NULL;
179} 122}
180 123
181#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT 124/* caller has locked the irq_desc and both params are valid */
182static inline int irq_balancing_disabled(unsigned int irq) 125static inline void __irq_set_handler_locked(unsigned int irq,
126 irq_flow_handler_t handler)
183{ 127{
184 struct irq_desc *desc; 128 struct irq_desc *desc;
185 129
186 desc = irq_to_desc(irq); 130 desc = irq_to_desc(irq);
187 return desc->status & IRQ_NO_BALANCING_MASK; 131 desc->handle_irq = handler;
188} 132}
189#endif
190 133
191/* caller has locked the irq_desc and both params are valid */ 134/* caller has locked the irq_desc and both params are valid */
192static inline void __set_irq_handler_unlocked(int irq, 135static inline void
193 irq_flow_handler_t handler) 136__irq_set_chip_handler_name_locked(unsigned int irq, struct irq_chip *chip,
137 irq_flow_handler_t handler, const char *name)
194{ 138{
195 struct irq_desc *desc; 139 struct irq_desc *desc;
196 140
197 desc = irq_to_desc(irq); 141 desc = irq_to_desc(irq);
142 irq_desc_get_irq_data(desc)->chip = chip;
198 desc->handle_irq = handler; 143 desc->handle_irq = handler;
144 desc->name = name;
145}
146
147static inline int irq_balancing_disabled(unsigned int irq)
148{
149 struct irq_desc *desc;
150
151 desc = irq_to_desc(irq);
152 return desc->status_use_accessors & IRQ_NO_BALANCING_MASK;
153}
154
155static inline void
156irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class)
157{
158 struct irq_desc *desc = irq_to_desc(irq);
159
160 if (desc)
161 lockdep_set_class(&desc->lock, class);
199} 162}
200 163
201#ifdef CONFIG_IRQ_PREFLOW_FASTEOI 164#ifdef CONFIG_IRQ_PREFLOW_FASTEOI