Ensure NO_IRQ is appropriately defined on all architectures
PATCH 2/5 Ensure NO_IRQ is appropriately defined on all architectures
Add a default definition of NO_IRQ to <linux/hardirq.h> and make the definition in <asm/hardirq.h> uniform across all architectures which define it.
---
include/asm-arm/irq.h | 5 +---- include/asm-arm26/irq.h | 5 +---- include/asm-frv/irq.h | 2 +- include/asm-parisc/irq.h | 2 +- include/asm-powerpc/irq.h | 2 +- include/linux/hardirq.h | 10 ++++++++++ 6 files changed, 15 insertions(+), 11 deletions(-)
applies-to: 48ad7d3f9b055a9d4c1a1ab1f6dd0a584cfed99c 8a7e8c26051c3abef81eb155c8a721716e24cc26
include/asm-arm/irq.h +1 -4
@@ -12,12 +12,9 @@#endif /* -* Use this value to indicate lack of interrupt -* capability +* Use this value to indicate lack of interrupt capability */ -#ifndef NO_IRQ #define NO_IRQ ((unsigned int)(-1)) -#endif struct irqaction ;
include/asm-arm26/irq.h +1 -4
@@ -15,12 +15,9 @@/* -* Use this value to indicate lack of interrupt -* capability +* Use this value to indicate lack of interrupt capability */ -#ifndef NO_IRQ #define NO_IRQ ((unsigned int)(-1)) -#endif struct irqaction ;
include/asm-frv/irq.h +1 -1
@@ -21,7 +21,7 @@*/ /* this number is used when no interrupt has been assigned */ -#define NO_IRQ (-1) +#define NO_IRQ ((unsigned int)(-1))#define NR_IRQ_LOG2_ACTIONS_PER_GROUP 5#define NR_IRQ_ACTIONS_PER_GROUP (1 << NR_IRQ_LOG2_ACTIONS_PER_GROUP)
include/asm-parisc/irq.h +1 -1
@@ -11,7 +11,7 @@#include <linux/cpumask.h> #include <asm/types.h> -#define NO_IRQ (-1) +#define NO_IRQ ((unsigned int)(-1))#ifdef CONFIG_GSC #define GSC_IRQ_BASE 16
include/asm-powerpc/irq.h +1 -1
@@ -16,7 +16,7 @@#include <asm/atomic.h> /* this number is used when no interrupt has been assigned */ -#define NO_IRQ (-1) +#define NO_IRQ ((unsigned int)(-1))/* * These constants are used for passing information about interrupt
include/linux/hardirq.h +10 -0
@@ -5,6 +5,7 @@#include <linux/preempt.h> #include <linux/smp_lock.h> #include <asm/hardirq.h> +#include <asm/irq.h> #include <asm/system.h> /*
@@ -87,6 +88,15 @@ extern void synchronize_irq(unsigned int# define synchronize_irq (irq) barrier()#endif +/* +* This value means "Device has no interrupt". The value 0 has +* historically been used, but it's a legal interrupt number on some +* architectures. These architectures typically define it to be -1 instead. +*/ +#ifndef NO_IRQ +#define NO_IRQ ((unsigned int)0) +#endif +#define nmi_enter () irq_enter()#define nmi_exit () sub_preempt_count(HARDIRQ_OFFSET)
---
0.99.8.GIT
Quoted 3 lines · Matthew Wilcox
Add a default definition of
NO_IRQto <linux/hardirq.h> and make the definition in <asm/hardirq.h> uniform across all architectures which define it.
I don't like this patch in the cold light of day, since I made the include mess worse than it already is. Updated patch to follow.
Quoted 3 lines · Matthew Wilcox
Add a default definition of
NO_IRQto <linux/hardirq.h> and make the definition in <asm/hardirq.h> uniform across all architectures which define it.
Please put the definition into <asm/irq.h> and <linux/interrupt.h>, hardirq.h is rather misnamed and about the internal irq/softirq/preempt mask mechanisms.
Quoted 8 lines · Christoph Hellwig
Quoted 3 lines · Matthew Wilcox
Add a default definition of
NO_IRQto <linux/hardirq.h> and make the definition in <asm/hardirq.h> uniform across all architectures which define it.Please put the definition into <
asm/irq.h> and <linux/interrupt.h>,hardirq.his rather misnamed and about the internal irq/softirq/preempt mask mechanisms.
Either you're wrong or I'm confused. I don't see the include path which necessarily drags asm/irq.h in from linux/interrupt.h. There's a linux/interrupt.h -> linux/hardirq.h -> asm/hardirq.h path, but not all asm/hardirq.h files drag in asm/irq.h. Look at sparc64 or alpha for examples of that.
Personally, I'd like to see asm/hardirq.h go away and move all its contents into asm/irq.h. And I'd like to see asm/irq.h included explicitly from linux/interrupt.h. And I'd like to see drivers stop including asm/irq.h.
While I'm dreaming, I'd like a pony.
Quoted 9 lines · Matthew Wilcox
Quoted 3 lines
Please put the definition into <
asm/irq.h> and <linux/interrupt.h>,hardirq.his rather misnamed and about the internal irq/softirq/preempt mask mechanisms.Either you're wrong or I'm confused. I don't see the include path which necessarily drags
asm/irq.hin fromlinux/interrupt.h. There's alinux/interrupt.h->linux/hardirq.h->asm/hardirq.hpath, but not allasm/hardirq.hfiles drag inasm/irq.h. Look at sparc64 or alpha for examples of that.
Indeed. But that still doesn't mean we should pollute <linux/hardirq.h> with it..
Quoted 4 lines
Personally, I'd like to see
asm/hardirq.hgo away and move all its contents intoasm/irq.h. And I'd like to seeasm/irq.hincluded explicitly fromlinux/interrupt.h. And I'd like to see drivers stop includingasm/irq.h.
Agreed.