From: Paul Jackson <pj@sgi.com>

Push the cpumask implementation from linux/cpumask.h into asm/cpumask.h, so
that ia64 can do special things without breaking sparc64.

1) Each arch has its own include/asm-<arch>/cpumask.h file

2) That arch-specific header file can include <asm-generic/cpumask.h>,
   if it wants to make use of the generic cpumask implementation.

3) Using code should continue to include linux/cpumask.h, which
   in turn includes asm/cpumask.h.  Some common implementation
   independent cpumask related items, such as the cpu_online_map,
   are declared directly in linux/cpumask.h.



 25-akpm/include/asm-alpha/cpumask.h     |    6 ++++
 25-akpm/include/asm-arm/cpumask.h       |    6 ++++
 25-akpm/include/asm-arm26/cpumask.h     |    6 ++++
 25-akpm/include/asm-cris/cpumask.h      |    6 ++++
 25-akpm/include/asm-generic/cpumask.h   |   40 ++++++++++++++++++++++++++++++++
 25-akpm/include/asm-h8300/cpumask.h     |    6 ++++
 25-akpm/include/asm-i386/cpumask.h      |    6 ++++
 25-akpm/include/asm-ia64/cpumask.h      |    6 ++++
 25-akpm/include/asm-m68k/cpumask.h      |    6 ++++
 25-akpm/include/asm-m68knommu/cpumask.h |    6 ++++
 25-akpm/include/asm-mips/cpumask.h      |    6 ++++
 25-akpm/include/asm-parisc/cpumask.h    |    6 ++++
 25-akpm/include/asm-ppc/cpumask.h       |    6 ++++
 25-akpm/include/asm-ppc64/cpumask.h     |    6 ++++
 25-akpm/include/asm-s390/cpumask.h      |    6 ++++
 25-akpm/include/asm-sh/cpumask.h        |    6 ++++
 25-akpm/include/asm-sparc/cpumask.h     |    6 ++++
 25-akpm/include/asm-sparc64/cpumask.h   |    6 ++++
 25-akpm/include/asm-um/cpumask.h        |    6 ++++
 25-akpm/include/asm-v850/cpumask.h      |    6 ++++
 25-akpm/include/asm-x86_64/cpumask.h    |    6 ++++
 25-akpm/include/linux/cpumask.h         |   37 +----------------------------
 22 files changed, 162 insertions(+), 35 deletions(-)

diff -puN /dev/null include/asm-alpha/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-alpha/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_ALPHA_CPUMASK_H
+#define _ASM_ALPHA_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_ALPHA_CPUMASK_H */
diff -puN /dev/null include/asm-arm26/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-arm26/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_ARM26_CPUMASK_H
+#define _ASM_ARM26_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_ARM26_CPUMASK_H */
diff -puN /dev/null include/asm-arm/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-arm/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_ARM_CPUMASK_H
+#define _ASM_ARM_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_ARM_CPUMASK_H */
diff -puN /dev/null include/asm-cris/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-cris/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_CRIS_CPUMASK_H
+#define _ASM_CRIS_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_CRIS_CPUMASK_H */
diff -puN /dev/null include/asm-generic/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-generic/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,40 @@
+#ifndef __ASM_GENERIC_CPUMASK_H
+#define __ASM_GENERIC_CPUMASK_H
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/threads.h>
+#include <linux/types.h>
+#include <linux/bitmap.h>
+
+#if NR_CPUS > BITS_PER_LONG && NR_CPUS != 1
+#define CPU_ARRAY_SIZE		BITS_TO_LONGS(NR_CPUS)
+
+struct cpumask
+{
+	unsigned long mask[CPU_ARRAY_SIZE];
+};
+
+typedef struct cpumask cpumask_t;
+
+#else
+typedef unsigned long cpumask_t;
+#endif
+
+#ifdef CONFIG_SMP
+#if NR_CPUS > BITS_PER_LONG
+#include <asm-generic/cpumask_array.h>
+#else
+#include <asm-generic/cpumask_arith.h>
+#endif
+#else
+#include <asm-generic/cpumask_up.h>
+#endif
+
+#if NR_CPUS <= 4*BITS_PER_LONG
+#include <asm-generic/cpumask_const_value.h>
+#else
+#include <asm-generic/cpumask_const_reference.h>
+#endif
+
+#endif /* __ASM_GENERIC_CPUMASK_H */
diff -puN /dev/null include/asm-h8300/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-h8300/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_H8300_CPUMASK_H
+#define _ASM_H8300_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_H8300_CPUMASK_H */
diff -puN /dev/null include/asm-i386/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-i386/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_I386_CPUMASK_H
+#define _ASM_I386_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_I386_CPUMASK_H */
diff -puN /dev/null include/asm-ia64/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-ia64/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_IA64_CPUMASK_H
+#define _ASM_IA64_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_IA64_CPUMASK_H */
diff -puN /dev/null include/asm-m68k/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-m68k/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_M68K_CPUMASK_H
+#define _ASM_M68K_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_M68K_CPUMASK_H */
diff -puN /dev/null include/asm-m68knommu/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-m68knommu/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_M68KNOMMU_CPUMASK_H
+#define _ASM_M68KNOMMU_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_M68KNOMMU_CPUMASK_H */
diff -puN /dev/null include/asm-mips/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-mips/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_MIPS_CPUMASK_H
+#define _ASM_MIPS_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_MIPS_CPUMASK_H */
diff -puN /dev/null include/asm-parisc/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-parisc/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_PARISC_CPUMASK_H
+#define _ASM_PARISC_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_PARISC_CPUMASK_H */
diff -puN /dev/null include/asm-ppc64/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-ppc64/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_PPC64_CPUMASK_H
+#define _ASM_PPC64_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_PPC64_CPUMASK_H */
diff -puN /dev/null include/asm-ppc/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-ppc/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_PPC_CPUMASK_H
+#define _ASM_PPC_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_PPC_CPUMASK_H */
diff -puN /dev/null include/asm-s390/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-s390/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_S390_CPUMASK_H
+#define _ASM_S390_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_S390_CPUMASK_H */
diff -puN /dev/null include/asm-sh/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-sh/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_SH_CPUMASK_H
+#define _ASM_SH_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_SH_CPUMASK_H */
diff -puN /dev/null include/asm-sparc64/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-sparc64/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_SPARC64_CPUMASK_H
+#define _ASM_SPARC64_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_SPARC64_CPUMASK_H */
diff -puN /dev/null include/asm-sparc/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-sparc/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_SPARC_CPUMASK_H
+#define _ASM_SPARC_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_SPARC_CPUMASK_H */
diff -puN /dev/null include/asm-um/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-um/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_UM_CPUMASK_H
+#define _ASM_UM_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_UM_CPUMASK_H */
diff -puN /dev/null include/asm-v850/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-v850/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_V850_CPUMASK_H
+#define _ASM_V850_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_V850_CPUMASK_H */
diff -puN /dev/null include/asm-x86_64/cpumask.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-x86_64/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -0,0 +1,6 @@
+#ifndef _ASM_X86_64_CPUMASK_H
+#define _ASM_X86_64_CPUMASK_H
+
+#include <asm-generic/cpumask.h>
+
+#endif /* _ASM_X86_64_CPUMASK_H */
diff -puN include/linux/cpumask.h~cpumask-header-reorg include/linux/cpumask.h
--- 25/include/linux/cpumask.h~cpumask-header-reorg	Tue Dec 16 13:02:36 2003
+++ 25-akpm/include/linux/cpumask.h	Tue Dec 16 13:02:36 2003
@@ -1,42 +1,9 @@
 #ifndef __LINUX_CPUMASK_H
 #define __LINUX_CPUMASK_H
 
-#include <linux/config.h>
-#include <linux/kernel.h>
 #include <linux/threads.h>
-#include <linux/types.h>
-#include <linux/bitmap.h>
-
-#if NR_CPUS > BITS_PER_LONG && NR_CPUS != 1
-#define CPU_ARRAY_SIZE		BITS_TO_LONGS(NR_CPUS)
-
-struct cpumask
-{
-	unsigned long mask[CPU_ARRAY_SIZE];
-};
-
-typedef struct cpumask cpumask_t;
-
-#else
-typedef unsigned long cpumask_t;
-#endif
-
-#ifdef CONFIG_SMP
-#if NR_CPUS > BITS_PER_LONG
-#include <asm-generic/cpumask_array.h>
-#else
-#include <asm-generic/cpumask_arith.h>
-#endif
-#else
-#include <asm-generic/cpumask_up.h>
-#endif
-
-#if NR_CPUS <= 4*BITS_PER_LONG
-#include <asm-generic/cpumask_const_value.h>
-#else
-#include <asm-generic/cpumask_const_reference.h>
-#endif
-
+#include <asm/cpumask.h>
+#include <asm/bug.h>
 
 #ifdef CONFIG_SMP
 

_