handle.c (46926b67fc663d357a1a8174328998a9e49da0b8) handle.c (cb5bc83225a86ca53bbb889ed8439e4fd6cf44ac)
1/*
2 * linux/kernel/irq/handle.c
3 *
4 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
5 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
6 *
7 * This file contains the core interrupt handling code.
8 *

--- 137 unchanged lines hidden (view full) ---

146 return 0;
147}
148
149early_param("nr_irq_desc", parse_nr_irq_desc);
150
151struct irq_desc *sparse_irqs;
152DEFINE_DYN_ARRAY(sparse_irqs, sizeof(struct irq_desc), nr_irq_desc, PAGE_SIZE, init_work);
153
1/*
2 * linux/kernel/irq/handle.c
3 *
4 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
5 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
6 *
7 * This file contains the core interrupt handling code.
8 *

--- 137 unchanged lines hidden (view full) ---

146 return 0;
147}
148
149early_param("nr_irq_desc", parse_nr_irq_desc);
150
151struct irq_desc *sparse_irqs;
152DEFINE_DYN_ARRAY(sparse_irqs, sizeof(struct irq_desc), nr_irq_desc, PAGE_SIZE, init_work);
153
154struct irq_desc *__irq_to_desc(unsigned int irq)
154struct irq_desc *irq_to_desc(unsigned int irq)
155{
156 struct irq_desc *desc;
157
158 BUG_ON(irq == -1U);
159
160 desc = &sparse_irqs[0];
161 while (desc) {
162 if (desc->irq == irq)
163 return desc;
164
165 if (desc->irq == -1U)
166 return NULL;
167
168 desc = desc->next;
169 }
170 return NULL;
171}
155{
156 struct irq_desc *desc;
157
158 BUG_ON(irq == -1U);
159
160 desc = &sparse_irqs[0];
161 while (desc) {
162 if (desc->irq == irq)
163 return desc;
164
165 if (desc->irq == -1U)
166 return NULL;
167
168 desc = desc->next;
169 }
170 return NULL;
171}
172struct irq_desc *irq_to_desc(unsigned int irq)
172struct irq_desc *irq_to_desc_alloc(unsigned int irq)
173{
174 struct irq_desc *desc, *desc_pri;
175 int i;
176 int count = 0;
177 unsigned long phys;
178 unsigned long total_bytes;
179
180 BUG_ON(irq == -1U);
181
182 desc_pri = desc = &sparse_irqs[0];
183 while (desc) {
184 if (desc->irq == irq)
185 return desc;
186
187 if (desc->irq == -1U) {
188 desc->irq = irq;
173{
174 struct irq_desc *desc, *desc_pri;
175 int i;
176 int count = 0;
177 unsigned long phys;
178 unsigned long total_bytes;
179
180 BUG_ON(irq == -1U);
181
182 desc_pri = desc = &sparse_irqs[0];
183 while (desc) {
184 if (desc->irq == irq)
185 return desc;
186
187 if (desc->irq == -1U) {
188 desc->irq = irq;
189 printk(KERN_DEBUG "found new irq_desc for irq %d\n", desc->irq);
189 return desc;
190 }
191 desc_pri = desc;
192 desc = desc->next;
193 count++;
194 }
195
196 /*

--- 34 unchanged lines hidden (view full) ---

231 for (i = 1; i < nr_irq_desc; i++)
232 desc[i-1].next = &desc[i];
233
234 /* init kstat_irqs, nr_cpu_ids is ready already */
235 init_kstat_irqs(desc, nr_irq_desc, nr_cpu_ids);
236
237 desc->irq = irq;
238 desc_pri->next = desc;
190 return desc;
191 }
192 desc_pri = desc;
193 desc = desc->next;
194 count++;
195 }
196
197 /*

--- 34 unchanged lines hidden (view full) ---

232 for (i = 1; i < nr_irq_desc; i++)
233 desc[i-1].next = &desc[i];
234
235 /* init kstat_irqs, nr_cpu_ids is ready already */
236 init_kstat_irqs(desc, nr_irq_desc, nr_cpu_ids);
237
238 desc->irq = irq;
239 desc_pri->next = desc;
239 {
240 /* double check if some one mess up the list */
241 struct irq_desc *desc;
242 int count = 0;
240 printk(KERN_DEBUG "1 found new irq_desc for irq %d and pri will be irq %d\n", desc->irq, desc_pri->irq);
243
241
244 desc = &sparse_irqs[0];
245 while (desc) {
246 printk(KERN_DEBUG "1 found irq_desc for irq %d\n", desc->irq);
247 if (desc->next)
248 printk(KERN_DEBUG "1 found irq_desc for irq %d and next will be irq %d\n", desc->irq, desc->next->irq);
249 desc = desc->next;
250 count++;
251 }
252 printk(KERN_DEBUG "1 all preallocted %d\n", count);
253 }
254
255 return desc;
256}
257#else
258struct irq_desc *irq_desc;
259DEFINE_DYN_ARRAY(irq_desc, sizeof(struct irq_desc), nr_irqs, PAGE_SIZE, init_work);
260
261#endif
262

--- 17 unchanged lines hidden (view full) ---

280#ifndef CONFIG_HAVE_SPARSE_IRQ
281struct irq_desc *irq_to_desc(unsigned int irq)
282{
283 if (irq < nr_irqs)
284 return &irq_desc[irq];
285
286 return NULL;
287}
242 return desc;
243}
244#else
245struct irq_desc *irq_desc;
246DEFINE_DYN_ARRAY(irq_desc, sizeof(struct irq_desc), nr_irqs, PAGE_SIZE, init_work);
247
248#endif
249

--- 17 unchanged lines hidden (view full) ---

267#ifndef CONFIG_HAVE_SPARSE_IRQ
268struct irq_desc *irq_to_desc(unsigned int irq)
269{
270 if (irq < nr_irqs)
271 return &irq_desc[irq];
272
273 return NULL;
274}
288struct irq_desc *__irq_to_desc(unsigned int irq)
275struct irq_desc *irq_to_desc_alloc(unsigned int irq)
289{
290 return irq_to_desc(irq);
291}
292#endif
293
294/*
295 * What should we do if we get a hw irq event on an illegal vector?
296 * Each architecture has to answer this themself.

--- 214 unchanged lines hidden ---
276{
277 return irq_to_desc(irq);
278}
279#endif
280
281/*
282 * What should we do if we get a hw irq event on an illegal vector?
283 * Each architecture has to answer this themself.

--- 214 unchanged lines hidden ---