diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-09-17 14:53:05 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-11-13 14:21:46 -0500 |
commit | 54197e43a4a9a0f3fc406d72d9815754e84fab1e (patch) | |
tree | 70db3c0a63b066ac7a8c9e7fabbb8127d73717da | |
parent | 09f90f6685cd88b6b904c141035d096169958cc4 (diff) |
hardirq: Make hardirq bits generic
There is no reason for per arch hardirq bits. Make them all generic
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130917183628.534494408@linutronix.de
-rw-r--r-- | arch/blackfin/include/asm/hardirq.h | 3 | ||||
-rw-r--r-- | arch/cris/include/asm/hardirq.h | 12 | ||||
-rw-r--r-- | arch/m32r/include/asm/hardirq.h | 16 | ||||
-rw-r--r-- | arch/m68k/include/asm/hardirq.h | 11 | ||||
-rw-r--r-- | arch/s390/include/asm/hardirq.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/hardirq_32.h | 1 | ||||
-rw-r--r-- | arch/sparc/include/asm/hardirq_64.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/hardirq.h | 2 | ||||
-rw-r--r-- | include/linux/preempt_mask.h | 30 |
9 files changed, 8 insertions, 71 deletions
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h index c078dd78d998..58b54a6d5a16 100644 --- a/arch/blackfin/include/asm/hardirq.h +++ b/arch/blackfin/include/asm/hardirq.h | |||
@@ -12,9 +12,6 @@ | |||
12 | extern void ack_bad_irq(unsigned int irq); | 12 | extern void ack_bad_irq(unsigned int irq); |
13 | #define ack_bad_irq ack_bad_irq | 13 | #define ack_bad_irq ack_bad_irq |
14 | 14 | ||
15 | /* Define until common code gets sane defaults */ | ||
16 | #define HARDIRQ_BITS 9 | ||
17 | |||
18 | #include <asm-generic/hardirq.h> | 15 | #include <asm-generic/hardirq.h> |
19 | 16 | ||
20 | #endif | 17 | #endif |
diff --git a/arch/cris/include/asm/hardirq.h b/arch/cris/include/asm/hardirq.h index 17bb12d760b2..04126f7bfab2 100644 --- a/arch/cris/include/asm/hardirq.h +++ b/arch/cris/include/asm/hardirq.h | |||
@@ -2,18 +2,6 @@ | |||
2 | #define __ASM_HARDIRQ_H | 2 | #define __ASM_HARDIRQ_H |
3 | 3 | ||
4 | #include <asm/irq.h> | 4 | #include <asm/irq.h> |
5 | |||
6 | #define HARDIRQ_BITS 8 | ||
7 | |||
8 | /* | ||
9 | * The hardirq mask has to be large enough to have | ||
10 | * space for potentially all IRQ sources in the system | ||
11 | * nesting on a single CPU: | ||
12 | */ | ||
13 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
14 | # error HARDIRQ_BITS is too low! | ||
15 | #endif | ||
16 | |||
17 | #include <asm-generic/hardirq.h> | 5 | #include <asm-generic/hardirq.h> |
18 | 6 | ||
19 | #endif /* __ASM_HARDIRQ_H */ | 7 | #endif /* __ASM_HARDIRQ_H */ |
diff --git a/arch/m32r/include/asm/hardirq.h b/arch/m32r/include/asm/hardirq.h index 4c31c0ae215e..5f2ac4f64ddf 100644 --- a/arch/m32r/include/asm/hardirq.h +++ b/arch/m32r/include/asm/hardirq.h | |||
@@ -3,22 +3,6 @@ | |||
3 | #define __ASM_HARDIRQ_H | 3 | #define __ASM_HARDIRQ_H |
4 | 4 | ||
5 | #include <asm/irq.h> | 5 | #include <asm/irq.h> |
6 | |||
7 | #if NR_IRQS > 256 | ||
8 | #define HARDIRQ_BITS 9 | ||
9 | #else | ||
10 | #define HARDIRQ_BITS 8 | ||
11 | #endif | ||
12 | |||
13 | /* | ||
14 | * The hardirq mask has to be large enough to have | ||
15 | * space for potentially all IRQ sources in the system | ||
16 | * nesting on a single CPU: | ||
17 | */ | ||
18 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
19 | # error HARDIRQ_BITS is too low! | ||
20 | #endif | ||
21 | |||
22 | #include <asm-generic/hardirq.h> | 6 | #include <asm-generic/hardirq.h> |
23 | 7 | ||
24 | #endif /* __ASM_HARDIRQ_H */ | 8 | #endif /* __ASM_HARDIRQ_H */ |
diff --git a/arch/m68k/include/asm/hardirq.h b/arch/m68k/include/asm/hardirq.h index db30ed276878..6c618529d9b9 100644 --- a/arch/m68k/include/asm/hardirq.h +++ b/arch/m68k/include/asm/hardirq.h | |||
@@ -5,17 +5,6 @@ | |||
5 | #include <linux/cache.h> | 5 | #include <linux/cache.h> |
6 | #include <asm/irq.h> | 6 | #include <asm/irq.h> |
7 | 7 | ||
8 | #define HARDIRQ_BITS 8 | ||
9 | |||
10 | /* | ||
11 | * The hardirq mask has to be large enough to have | ||
12 | * space for potentially all IRQ sources in the system | ||
13 | * nesting on a single CPU: | ||
14 | */ | ||
15 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
16 | # error HARDIRQ_BITS is too low! | ||
17 | #endif | ||
18 | |||
19 | #ifdef CONFIG_MMU | 8 | #ifdef CONFIG_MMU |
20 | 9 | ||
21 | static inline void ack_bad_irq(unsigned int irq) | 10 | static inline void ack_bad_irq(unsigned int irq) |
diff --git a/arch/s390/include/asm/hardirq.h b/arch/s390/include/asm/hardirq.h index a908d2941c5d..b7eabaaeffbd 100644 --- a/arch/s390/include/asm/hardirq.h +++ b/arch/s390/include/asm/hardirq.h | |||
@@ -18,8 +18,6 @@ | |||
18 | #define __ARCH_HAS_DO_SOFTIRQ | 18 | #define __ARCH_HAS_DO_SOFTIRQ |
19 | #define __ARCH_IRQ_EXIT_IRQS_DISABLED | 19 | #define __ARCH_IRQ_EXIT_IRQS_DISABLED |
20 | 20 | ||
21 | #define HARDIRQ_BITS 8 | ||
22 | |||
23 | static inline void ack_bad_irq(unsigned int irq) | 21 | static inline void ack_bad_irq(unsigned int irq) |
24 | { | 22 | { |
25 | printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); | 23 | printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); |
diff --git a/arch/sparc/include/asm/hardirq_32.h b/arch/sparc/include/asm/hardirq_32.h index 162007643cdc..ee93923b7f82 100644 --- a/arch/sparc/include/asm/hardirq_32.h +++ b/arch/sparc/include/asm/hardirq_32.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #ifndef __SPARC_HARDIRQ_H | 7 | #ifndef __SPARC_HARDIRQ_H |
8 | #define __SPARC_HARDIRQ_H | 8 | #define __SPARC_HARDIRQ_H |
9 | 9 | ||
10 | #define HARDIRQ_BITS 8 | ||
11 | #include <asm-generic/hardirq.h> | 10 | #include <asm-generic/hardirq.h> |
12 | 11 | ||
13 | #endif /* __SPARC_HARDIRQ_H */ | 12 | #endif /* __SPARC_HARDIRQ_H */ |
diff --git a/arch/sparc/include/asm/hardirq_64.h b/arch/sparc/include/asm/hardirq_64.h index 7c29fd1a87aa..f478ff1ddd02 100644 --- a/arch/sparc/include/asm/hardirq_64.h +++ b/arch/sparc/include/asm/hardirq_64.h | |||
@@ -14,6 +14,4 @@ | |||
14 | 14 | ||
15 | void ack_bad_irq(unsigned int irq); | 15 | void ack_bad_irq(unsigned int irq); |
16 | 16 | ||
17 | #define HARDIRQ_BITS 8 | ||
18 | |||
19 | #endif /* !(__SPARC64_HARDIRQ_H) */ | 17 | #endif /* !(__SPARC64_HARDIRQ_H) */ |
diff --git a/arch/tile/include/asm/hardirq.h b/arch/tile/include/asm/hardirq.h index 822390f9a154..54110af23985 100644 --- a/arch/tile/include/asm/hardirq.h +++ b/arch/tile/include/asm/hardirq.h | |||
@@ -42,6 +42,4 @@ DECLARE_PER_CPU(irq_cpustat_t, irq_stat); | |||
42 | 42 | ||
43 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 43 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
44 | 44 | ||
45 | #define HARDIRQ_BITS 8 | ||
46 | |||
47 | #endif /* _ASM_TILE_HARDIRQ_H */ | 45 | #endif /* _ASM_TILE_HARDIRQ_H */ |
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index 931bc616219f..810d7e386f20 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h | |||
@@ -11,36 +11,22 @@ | |||
11 | * - bits 0-7 are the preemption count (max preemption depth: 256) | 11 | * - bits 0-7 are the preemption count (max preemption depth: 256) |
12 | * - bits 8-15 are the softirq count (max # of softirqs: 256) | 12 | * - bits 8-15 are the softirq count (max # of softirqs: 256) |
13 | * | 13 | * |
14 | * The hardirq count can in theory reach the same as NR_IRQS. | 14 | * The hardirq count could in theory be the same as the number of |
15 | * In reality, the number of nested IRQS is limited to the stack | 15 | * interrupts in the system, but we run all interrupt handlers with |
16 | * size as well. For archs with over 1000 IRQS it is not practical | 16 | * interrupts disabled, so we cannot have nesting interrupts. Though |
17 | * to expect that they will all nest. We give a max of 10 bits for | 17 | * there are a few palaeontologic drivers which reenable interrupts in |
18 | * hardirq nesting. An arch may choose to give less than 10 bits. | 18 | * the handler, so we need more than one bit here. |
19 | * m68k expects it to be 8. | ||
20 | * | ||
21 | * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) | ||
22 | * - bit 26 is the NMI_MASK | ||
23 | * - bit 27 is the PREEMPT_ACTIVE flag | ||
24 | * | 19 | * |
25 | * PREEMPT_MASK: 0x000000ff | 20 | * PREEMPT_MASK: 0x000000ff |
26 | * SOFTIRQ_MASK: 0x0000ff00 | 21 | * SOFTIRQ_MASK: 0x0000ff00 |
27 | * HARDIRQ_MASK: 0x03ff0000 | 22 | * HARDIRQ_MASK: 0x000f0000 |
28 | * NMI_MASK: 0x04000000 | 23 | * NMI_MASK: 0x00100000 |
29 | */ | 24 | */ |
30 | #define PREEMPT_BITS 8 | 25 | #define PREEMPT_BITS 8 |
31 | #define SOFTIRQ_BITS 8 | 26 | #define SOFTIRQ_BITS 8 |
27 | #define HARDIRQ_BITS 4 | ||
32 | #define NMI_BITS 1 | 28 | #define NMI_BITS 1 |
33 | 29 | ||
34 | #define MAX_HARDIRQ_BITS 10 | ||
35 | |||
36 | #ifndef HARDIRQ_BITS | ||
37 | # define HARDIRQ_BITS MAX_HARDIRQ_BITS | ||
38 | #endif | ||
39 | |||
40 | #if HARDIRQ_BITS > MAX_HARDIRQ_BITS | ||
41 | #error HARDIRQ_BITS too high! | ||
42 | #endif | ||
43 | |||
44 | #define PREEMPT_SHIFT 0 | 30 | #define PREEMPT_SHIFT 0 |
45 | #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) | 31 | #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) |
46 | #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) | 32 | #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) |