aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irq.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-10-04 05:16:37 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:27 -0400
commit3a16d713626735f3016da0521b7bf251cd78e836 (patch)
tree39147d40b681391a578b19fceb50dfe5a7a4a1ab /include/linux/irq.h
parent92db6d10bc1bc43330a4c540fa5b64c83d9d865f (diff)
[PATCH] genirq: irq: add a dynamic irq creation API
With the msi support comes a new concept in irq handling, irqs that are created dynamically at run time. Currently the msi code allocates irqs backwards. First it allocates a platform dependent routing value for an interrupt the ``vector'' and then it figures out from the vector which irq you are on. This msi backwards allocator suffers from two basic problems. The allocator suffers because it is trying to do something that is architecture specific in a generic way making it brittle, inflexible, and tied to tightly to the architecture implementation. The alloctor also suffers from it's very backwards nature as it has tied things together that should have no dependencies. To solve the basic dynamic irq allocation problem two new architecture specific functions are added: create_irq and destroy_irq. create_irq takes no input and returns an unused irq number, that won't be reused until it is returned to the free poll with destroy_irq. The irq then can be used for any purpose although the only initial consumer is the msi code. destroy_irq takes an irq number allocated with create_irq and returns it to the free pool. Making this functionality per architecture increases the simplicity of the irq allocation code and increases it's flexibility. dynamic_irq_init() and dynamic_irq_cleanup() are added to automate the irq_desc initializtion that should happen for dynamic irqs. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Rajesh Shah <rajesh.shah@intel.com> Cc: Andi Kleen <ak@muc.de> Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/irq.h')
-rw-r--r--include/linux/irq.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index a31a7d8acdb2..82dbb0e8f40b 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -404,8 +404,15 @@ set_irq_chained_handler(unsigned int irq,
404 __set_irq_handler(irq, handle, 1); 404 __set_irq_handler(irq, handle, 1);
405} 405}
406 406
407/* Set/get chip/data for an IRQ: */ 407/* Handle dynamic irq creation and destruction */
408extern int create_irq(void);
409extern void destroy_irq(unsigned int irq);
410
411/* Dynamic irq helper functions */
412extern void dynamic_irq_init(unsigned int irq);
413extern void dynamic_irq_cleanup(unsigned int irq);
408 414
415/* Set/get chip/data for an IRQ: */
409extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); 416extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
410extern int set_irq_data(unsigned int irq, void *data); 417extern int set_irq_data(unsigned int irq, void *data);
411extern int set_irq_chip_data(unsigned int irq, void *data); 418extern int set_irq_chip_data(unsigned int irq, void *data);