aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-06-29 05:24:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-29 13:26:21 -0400
commitd1bef4ed5faf7d9872337b33c4269e45ae1bf960 (patch)
treea88c58e3102396382e9137a25a884af14421f6a6 /kernel/irq/manage.c
parentcfb9e32f2ff32ef5265c1c80fe68dd1a7f03a604 (diff)
[PATCH] genirq: rename desc->handler to desc->chip
This patch-queue improves the generic IRQ layer to be truly generic, by adding various abstractions and features to it, without impacting existing functionality. While the queue can be best described as "fix and improve everything in the generic IRQ layer that we could think of", and thus it consists of many smaller features and lots of cleanups, the one feature that stands out most is the new 'irq chip' abstraction. The irq-chip abstraction is about describing and coding and IRQ controller driver by mapping its raw hardware capabilities [and quirks, if needed] in a straightforward way, without having to think about "IRQ flow" (level/edge/etc.) type of details. This stands in contrast with the current 'irq-type' model of genirq architectures, which 'mixes' raw hardware capabilities with 'flow' details. The patchset supports both types of irq controller designs at once, and converts i386 and x86_64 to the new irq-chip design. As a bonus side-effect of the irq-chip approach, chained interrupt controllers (master/slave PIC constructs, etc.) are now supported by design as well. The end result of this patchset intends to be simpler architecture-level code and more consolidation between architectures. We reused many bits of code and many concepts from Russell King's ARM IRQ layer, the merging of which was one of the motivations for this patchset. This patch: rename desc->handler to desc->chip. Originally i did not want to do this, because it's a big patch. But having both "desc->handler", "desc->handle_irq" and "action->handler" caused a large degree of confusion and made the code appear alot less clean than it truly is. I have also attempted a dual approach as well by introducing a desc->chip alias - but that just wasnt robust enough and broke frequently. So lets get over with this quickly. The conversion was done automatically via scripts and converts all the code in the kernel. This renaming patch is the first one amongst the patches, so that the remaining patches can stay flexible and can be merged and split up without having some big monolithic patch act as a merge barrier. [akpm@osdl.org: build fix] [akpm@osdl.org: another build fix] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 1279e3499534..31ee1f3bfcf9 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -69,7 +69,7 @@ void disable_irq_nosync(unsigned int irq)
69 spin_lock_irqsave(&desc->lock, flags); 69 spin_lock_irqsave(&desc->lock, flags);
70 if (!desc->depth++) { 70 if (!desc->depth++) {
71 desc->status |= IRQ_DISABLED; 71 desc->status |= IRQ_DISABLED;
72 desc->handler->disable(irq); 72 desc->chip->disable(irq);
73 } 73 }
74 spin_unlock_irqrestore(&desc->lock, flags); 74 spin_unlock_irqrestore(&desc->lock, flags);
75} 75}
@@ -131,9 +131,9 @@ void enable_irq(unsigned int irq)
131 desc->status = status; 131 desc->status = status;
132 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { 132 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
133 desc->status = status | IRQ_REPLAY; 133 desc->status = status | IRQ_REPLAY;
134 hw_resend_irq(desc->handler,irq); 134 hw_resend_irq(desc->chip,irq);
135 } 135 }
136 desc->handler->enable(irq); 136 desc->chip->enable(irq);
137 /* fall-through */ 137 /* fall-through */
138 } 138 }
139 default: 139 default:
@@ -178,7 +178,7 @@ int setup_irq(unsigned int irq, struct irqaction * new)
178 if (irq >= NR_IRQS) 178 if (irq >= NR_IRQS)
179 return -EINVAL; 179 return -EINVAL;
180 180
181 if (desc->handler == &no_irq_type) 181 if (desc->chip == &no_irq_type)
182 return -ENOSYS; 182 return -ENOSYS;
183 /* 183 /*
184 * Some drivers like serial.c use request_irq() heavily, 184 * Some drivers like serial.c use request_irq() heavily,
@@ -230,10 +230,10 @@ int setup_irq(unsigned int irq, struct irqaction * new)
230 desc->depth = 0; 230 desc->depth = 0;
231 desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | 231 desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT |
232 IRQ_WAITING | IRQ_INPROGRESS); 232 IRQ_WAITING | IRQ_INPROGRESS);
233 if (desc->handler->startup) 233 if (desc->chip->startup)
234 desc->handler->startup(irq); 234 desc->chip->startup(irq);
235 else 235 else
236 desc->handler->enable(irq); 236 desc->chip->enable(irq);
237 } 237 }
238 spin_unlock_irqrestore(&desc->lock,flags); 238 spin_unlock_irqrestore(&desc->lock,flags);
239 239
@@ -295,16 +295,16 @@ void free_irq(unsigned int irq, void *dev_id)
295 295
296 /* Currently used only by UML, might disappear one day.*/ 296 /* Currently used only by UML, might disappear one day.*/
297#ifdef CONFIG_IRQ_RELEASE_METHOD 297#ifdef CONFIG_IRQ_RELEASE_METHOD
298 if (desc->handler->release) 298 if (desc->chip->release)
299 desc->handler->release(irq, dev_id); 299 desc->chip->release(irq, dev_id);
300#endif 300#endif
301 301
302 if (!desc->action) { 302 if (!desc->action) {
303 desc->status |= IRQ_DISABLED; 303 desc->status |= IRQ_DISABLED;
304 if (desc->handler->shutdown) 304 if (desc->chip->shutdown)
305 desc->handler->shutdown(irq); 305 desc->chip->shutdown(irq);
306 else 306 else
307 desc->handler->disable(irq); 307 desc->chip->disable(irq);
308 } 308 }
309 spin_unlock_irqrestore(&desc->lock,flags); 309 spin_unlock_irqrestore(&desc->lock,flags);
310 unregister_handler_proc(irq, action); 310 unregister_handler_proc(irq, action);