From: Paul Jackson <pj@sgi.com>

The patch is needed to build NR_CPUS > 256.

Without this fix, you get compile errors:
    include/linux/cpumask.h: In function `next_online_cpu':
    include/linux/cpumask.h:56: structure has no member named `val'



 include/asm-generic/cpumask_const_value.h |    2 +-
 include/asm-i386/mach-default/mach_apic.h |    6 +++---
 include/linux/cpumask.h                   |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff -puN include/asm-generic/cpumask_const_value.h~more-than-256-cpus include/asm-generic/cpumask_const_value.h
--- 25/include/asm-generic/cpumask_const_value.h~more-than-256-cpus	2003-11-07 12:51:11.000000000 -0800
+++ 25-akpm/include/asm-generic/cpumask_const_value.h	2003-11-07 12:51:11.000000000 -0800
@@ -3,7 +3,7 @@
 
 typedef const cpumask_t cpumask_const_t;
 
-#define mk_cpumask_const(map)		((cpumask_const_t)(map))
+#define mk_cpumask_const(map)		(map)
 #define cpu_isset_const(cpu, map)	cpu_isset(cpu, map)
 #define cpus_and_const(dst,src1,src2)	cpus_and(dst, src1, src2)
 #define cpus_or_const(dst,src1,src2)	cpus_or(dst, src1, src2)
diff -puN include/asm-i386/mach-default/mach_apic.h~more-than-256-cpus include/asm-i386/mach-default/mach_apic.h
--- 25/include/asm-i386/mach-default/mach_apic.h~more-than-256-cpus	2003-11-07 12:51:11.000000000 -0800
+++ 25-akpm/include/asm-i386/mach-default/mach_apic.h	2003-11-07 12:51:11.000000000 -0800
@@ -5,12 +5,12 @@
 
 #define APIC_DFR_VALUE	(APIC_DFR_FLAT)
 
-static inline cpumask_t target_cpus(void)
+static inline cpumask_const_t target_cpus(void)
 { 
 #ifdef CONFIG_SMP
-	return cpu_online_map;
+	return mk_cpumask_const(cpu_online_map);
 #else
-	return cpumask_of_cpu(0);
+	return mk_cpumask_const(cpumask_of_cpu(0));
 #endif
 } 
 #define TARGET_CPUS (target_cpus())
diff -puN include/linux/cpumask.h~more-than-256-cpus include/linux/cpumask.h
--- 25/include/linux/cpumask.h~more-than-256-cpus	2003-11-07 12:51:11.000000000 -0800
+++ 25-akpm/include/linux/cpumask.h	2003-11-07 12:51:11.000000000 -0800
@@ -53,18 +53,18 @@ extern cpumask_t cpu_online_map;
 static inline int next_online_cpu(int cpu, cpumask_t map)
 {
 	do
-		cpu = next_cpu_const(cpu, map);
+		cpu = next_cpu_const(cpu, mk_cpumask_const(map));
 	while (cpu < NR_CPUS && !cpu_online(cpu));
 	return cpu;
 }
 
 #define for_each_cpu(cpu, map)						\
-	for (cpu = first_cpu_const(map);				\
+	for (cpu = first_cpu_const(mk_cpumask_const(map));		\
 		cpu < NR_CPUS;						\
-		cpu = next_cpu_const(cpu,map))
+		cpu = next_cpu_const(cpu,mk_cpumask_const(map)))
 
 #define for_each_online_cpu(cpu, map)					\
-	for (cpu = first_cpu_const(map);				\
+	for (cpu = first_cpu_const(mk_cpumask_const(map));		\
 		cpu < NR_CPUS;						\
 		cpu = next_online_cpu(cpu,map))
 

_