From: Christoph Hellwig PREEMPT_BITS, SOFTIRQ_BITS, PREEMPT_SHIFT, SOFTIRQ_SHIFT and HARDIRQ_SHIFT are the same for all architectures (and chaning them in future ports doesn't make a lot of sense), so move them to . Make the HARDIRQ_BITS definition guarded by #ifndef HARDIRQ_BITS instead of CONFIG_GENERIC_HARDIRQS so we have a saner way to override it once ports with lots of irq sources are changed to use the generic hardirq framework. Ingo, maybe we should change the default for it back to 8 as that's what most ports use? Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton --- 25-akpm/include/asm-alpha/hardirq.h | 21 --------------------- 25-akpm/include/asm-arm/hardirq.h | 19 ------------------- 25-akpm/include/asm-arm26/hardirq.h | 15 --------------- 25-akpm/include/asm-cris/hardirq.h | 21 --------------------- 25-akpm/include/asm-h8300/hardirq.h | 21 --------------------- 25-akpm/include/asm-ia64/hardirq.h | 21 --------------------- 25-akpm/include/asm-m32r/hardirq.h | 22 ---------------------- 25-akpm/include/asm-m68k/hardirq.h | 21 --------------------- 25-akpm/include/asm-m68knommu/hardirq.h | 21 --------------------- 25-akpm/include/asm-mips/hardirq.h | 21 --------------------- 25-akpm/include/asm-parisc/hardirq.h | 21 --------------------- 25-akpm/include/asm-s390/hardirq.h | 21 --------------------- 25-akpm/include/asm-sh/hardirq.h | 21 --------------------- 25-akpm/include/asm-sparc/hardirq.h | 21 --------------------- 25-akpm/include/asm-sparc64/hardirq.h | 21 --------------------- 25-akpm/include/asm-v850/hardirq.h | 21 --------------------- 25-akpm/include/linux/hardirq.h | 24 ++++++++++++------------ 17 files changed, 12 insertions(+), 341 deletions(-) diff -puN include/asm-alpha/hardirq.h~more-hardirqh-consolidation include/asm-alpha/hardirq.h --- 25/include/asm-alpha/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.033228776 -0800 +++ 25-akpm/include/asm-alpha/hardirq.h 2004-11-03 19:01:31.058224976 -0800 @@ -16,29 +16,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-27 are the hardirq count (max # of hardirqs: 4096) - * - * - ( bit 30 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x0fff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 12 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially nestable IRQ sources in the system diff -puN include/asm-arm26/hardirq.h~more-hardirqh-consolidation include/asm-arm26/hardirq.h --- 25/include/asm-arm26/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.034228624 -0800 +++ 25-akpm/include/asm-arm26/hardirq.h 2004-11-03 19:01:31.058224976 -0800 @@ -15,23 +15,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - bit 26 is the PREEMPT_ACTIVE flag - */ -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have space * for potentially all IRQ sources in the system nesting diff -puN include/asm-arm/hardirq.h~more-hardirqh-consolidation include/asm-arm/hardirq.h --- 25/include/asm-arm/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.035228472 -0800 +++ 25-akpm/include/asm-arm/hardirq.h 2004-11-03 19:01:31.058224976 -0800 @@ -12,31 +12,12 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-24 are the hardirq count (max # of hardirqs: 512) - * - bit 26 is the PREEMPT_ACTIVE flag - * - * We optimize HARDIRQ_BITS for immediate constant, and only - * increase it if really needed. - */ -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 - #if NR_IRQS > 256 #define HARDIRQ_BITS 9 #else #define HARDIRQ_BITS 8 #endif -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have space * for potentially all IRQ sources in the system nesting diff -puN include/asm-cris/hardirq.h~more-hardirqh-consolidation include/asm-cris/hardirq.h --- 25/include/asm-cris/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.036228320 -0800 +++ 25-akpm/include/asm-cris/hardirq.h 2004-11-03 19:01:31.059224824 -0800 @@ -17,29 +17,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-h8300/hardirq.h~more-hardirqh-consolidation include/asm-h8300/hardirq.h --- 25/include/asm-h8300/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.038228016 -0800 +++ 25-akpm/include/asm-h8300/hardirq.h 2004-11-03 19:01:31.059224824 -0800 @@ -15,29 +15,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * HARDIRQ_MASK: 0x0000ff00 - * SOFTIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-ia64/hardirq.h~more-hardirqh-consolidation include/asm-ia64/hardirq.h --- 25/include/asm-ia64/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.039227864 -0800 +++ 25-akpm/include/asm-ia64/hardirq.h 2004-11-03 19:01:31.060224672 -0800 @@ -29,29 +29,8 @@ #define local_ksoftirqd_task() (local_cpu_data->ksoftirqd) #define local_nmi_count() 0 -/* - * We put the hardirq and softirq counter into the preemption counter. The bitmask has the - * following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-29 are the hardirq count (max # of hardirqs: 16384) - * - * - (bit 63 is the PREEMPT_ACTIVE flag---not currently implemented.) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x3fff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 14 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have space for potentially all IRQ sources * in the system nesting on a single CPU: diff -puN include/asm-m32r/hardirq.h~more-hardirqh-consolidation include/asm-m32r/hardirq.h --- 25/include/asm-m32r/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.040227712 -0800 +++ 25-akpm/include/asm-m32r/hardirq.h 2004-11-03 19:01:31.060224672 -0800 @@ -13,34 +13,12 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 - #if NR_IRQS > 256 #define HARDIRQ_BITS 9 #else #define HARDIRQ_BITS 8 #endif -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-m68k/hardirq.h~more-hardirqh-consolidation include/asm-m68k/hardirq.h --- 25/include/asm-m68k/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.042227408 -0800 +++ 25-akpm/include/asm-m68k/hardirq.h 2004-11-03 19:01:31.061224520 -0800 @@ -12,29 +12,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * HARDIRQ_MASK: 0x0000ff00 - * SOFTIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-m68knommu/hardirq.h~more-hardirqh-consolidation include/asm-m68knommu/hardirq.h --- 25/include/asm-m68knommu/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.043227256 -0800 +++ 25-akpm/include/asm-m68knommu/hardirq.h 2004-11-03 19:01:31.061224520 -0800 @@ -13,29 +13,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * HARDIRQ_MASK: 0x0000ff00 - * SOFTIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-mips/hardirq.h~more-hardirqh-consolidation include/asm-mips/hardirq.h --- 25/include/asm-mips/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.045226952 -0800 +++ 25-akpm/include/asm-mips/hardirq.h 2004-11-03 19:01:31.061224520 -0800 @@ -20,29 +20,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-parisc/hardirq.h~more-hardirqh-consolidation include/asm-parisc/hardirq.h --- 25/include/asm-parisc/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.046226800 -0800 +++ 25-akpm/include/asm-parisc/hardirq.h 2004-11-03 19:01:31.062224368 -0800 @@ -28,29 +28,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption counter. The bitmask has the - * following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-31 are the hardirq count (max # of hardirqs: 65536) - * - * - (bit 63 is the PREEMPT_ACTIVE flag---not currently implemented.) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0xffff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 16 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have space for potentially all IRQ sources * in the system nesting on a single CPU: diff -puN include/asm-s390/hardirq.h~more-hardirqh-consolidation include/asm-s390/hardirq.h --- 25/include/asm-s390/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.047226648 -0800 +++ 25-akpm/include/asm-s390/hardirq.h 2004-11-03 19:01:31.062224368 -0800 @@ -38,29 +38,8 @@ softirq_pending(unsigned int cpu) #define __ARCH_IRQ_STAT -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - extern void account_ticks(struct pt_regs *); #define __ARCH_HAS_DO_SOFTIRQ diff -puN include/asm-sh/hardirq.h~more-hardirqh-consolidation include/asm-sh/hardirq.h --- 25/include/asm-sh/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.049226344 -0800 +++ 25-akpm/include/asm-sh/hardirq.h 2004-11-03 19:01:31.063224216 -0800 @@ -12,29 +12,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/asm-sparc64/hardirq.h~more-hardirqh-consolidation include/asm-sparc64/hardirq.h --- 25/include/asm-sparc64/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.050226192 -0800 +++ 25-akpm/include/asm-sparc64/hardirq.h 2004-11-03 19:01:31.064224064 -0800 @@ -18,29 +18,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - #define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #define irq_exit() \ do { \ diff -puN include/asm-sparc/hardirq.h~more-hardirqh-consolidation include/asm-sparc/hardirq.h --- 25/include/asm-sparc/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.051226040 -0800 +++ 25-akpm/include/asm-sparc/hardirq.h 2004-11-03 19:01:31.063224216 -0800 @@ -19,29 +19,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - #define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #define irq_exit() \ do { \ diff -puN include/asm-v850/hardirq.h~more-hardirqh-consolidation include/asm-v850/hardirq.h --- 25/include/asm-v850/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.053225736 -0800 +++ 25-akpm/include/asm-v850/hardirq.h 2004-11-03 19:01:31.064224064 -0800 @@ -13,29 +13,8 @@ typedef struct { #include /* Standard mappings for irq_cpustat_t above */ -/* - * We put the hardirq and softirq counter into the preemption - * counter. The bitmask has the following meaning: - * - * - bits 0-7 are the preemption count (max preemption depth: 256) - * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-23 are the hardirq count (max # of hardirqs: 256) - * - * - ( bit 26 is the PREEMPT_ACTIVE flag. ) - * - * PREEMPT_MASK: 0x000000ff - * HARDIRQ_MASK: 0x0000ff00 - * SOFTIRQ_MASK: 0x00ff0000 - */ - -#define PREEMPT_BITS 8 -#define SOFTIRQ_BITS 8 #define HARDIRQ_BITS 8 -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) - /* * The hardirq mask has to be large enough to have * space for potentially all IRQ sources in the system diff -puN include/linux/hardirq.h~more-hardirqh-consolidation include/linux/hardirq.h --- 25/include/linux/hardirq.h~more-hardirqh-consolidation 2004-11-03 19:01:31.054225584 -0800 +++ 25-akpm/include/linux/hardirq.h 2004-11-03 19:01:31.065223912 -0800 @@ -5,39 +5,39 @@ #include #include -#ifdef CONFIG_GENERIC_HARDIRQS /* * We put the hardirq and softirq counter into the preemption * counter. The bitmask has the following meaning: * * - bits 0-7 are the preemption count (max preemption depth: 256) * - bits 8-15 are the softirq count (max # of softirqs: 256) - * - bits 16-27 are the hardirq count (max # of hardirqs: 4096) * + * The hardirq count can be overridden per architecture, the default is: + * + * - bits 16-27 are the hardirq count (max # of hardirqs: 4096) * - ( bit 28 is the PREEMPT_ACTIVE flag. ) * * PREEMPT_MASK: 0x000000ff * SOFTIRQ_MASK: 0x0000ff00 * HARDIRQ_MASK: 0x0fff0000 */ - #define PREEMPT_BITS 8 #define SOFTIRQ_BITS 8 -#define HARDIRQ_BITS 12 - -#define PREEMPT_SHIFT 0 -#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) +#ifndef HARDIRQ_BITS +#define HARDIRQ_BITS 12 /* - * The hardirq mask has to be large enough to have - * space for potentially all IRQ sources in the system - * nesting on a single CPU: + * The hardirq mask has to be large enough to have space for potentially + * all IRQ sources in the system nesting on a single CPU. */ #if (1 << HARDIRQ_BITS) < NR_IRQS # error HARDIRQ_BITS is too low! #endif -#endif /* CONFIG_GENERIC_HARDIRQS */ +#endif + +#define PREEMPT_SHIFT 0 +#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) +#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) #define __IRQ_MASK(x) ((1UL << (x))-1) _