--- include/asm-generic/percpu.h | 10 ---------- include/asm-ia64/percpu.h | 8 -------- include/asm-powerpc/percpu.h | 3 --- include/asm-sparc64/percpu.h | 8 -------- include/linux/percpu.h | 41 ----------------------------------------- init/main.c | 4 ++-- 6 files changed, 2 insertions(+), 72 deletions(-) Index: linux-2.6/include/asm-generic/percpu.h =================================================================== --- linux-2.6.orig/include/asm-generic/percpu.h 2007-11-27 17:41:44.773463500 -0800 +++ linux-2.6/include/asm-generic/percpu.h 2007-11-27 17:44:13.207962805 -0800 @@ -9,8 +9,6 @@ */ #define per_cpu_var(var) per_cpu__##var -#ifdef CONFIG_SMP - /* * per_cpu_offset() is the offset that has to be added to a * percpu variable to get to the instance for a certain processor. @@ -58,14 +56,6 @@ extern unsigned long __per_cpu_offset[NR extern void setup_per_cpu_areas(void); #endif -#else /* ! SMP */ - -#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) -#define __get_cpu_var(var) per_cpu_var(var) -#define __raw_get_cpu_var(var) per_cpu_var(var) - -#endif /* SMP */ - #ifndef PER_CPU_ATTRIBUTES #define PER_CPU_ATTRIBUTES #endif Index: linux-2.6/include/linux/percpu.h =================================================================== --- linux-2.6.orig/include/linux/percpu.h 2007-11-27 17:41:44.809463469 -0800 +++ linux-2.6/include/linux/percpu.h 2007-11-27 17:43:22.828963039 -0800 @@ -13,15 +13,10 @@ __attribute__((__section__(".data.percpu"))) \ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name -#ifdef CONFIG_SMP #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ __attribute__((__section__(".data.percpu.shared_aligned"))) \ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ ____cacheline_aligned_in_smp -#else -#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ - DEFINE_PER_CPU(type, name) -#endif #define DEFINE_PER_CPU_FIRST(type, name) \ __attribute__((__section__(".data.percpu.first"))) \ @@ -78,42 +73,6 @@ extern void __percpu_depopulate_mask(voi extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask); extern void percpu_free(void *__pdata); -#else /* CONFIG_SMP */ - -#define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) - -static inline void percpu_depopulate(void *__pdata, int cpu) -{ -} - -static inline void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask) -{ -} - -static inline void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, - int cpu) -{ - return percpu_ptr(__pdata, cpu); -} - -static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, - cpumask_t *mask) -{ - return 0; -} - -static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) -{ - return kzalloc(size, gfp); -} - -static inline void percpu_free(void *__pdata) -{ - kfree(__pdata); -} - -#endif /* CONFIG_SMP */ - #define percpu_populate_mask(__pdata, size, gfp, mask) \ __percpu_populate_mask((__pdata), (size), (gfp), &(mask)) #define percpu_depopulate_mask(__pdata, mask) \ Index: linux-2.6/include/asm-ia64/percpu.h =================================================================== --- linux-2.6.orig/include/asm-ia64/percpu.h 2007-11-27 17:37:24.352687353 -0800 +++ linux-2.6/include/asm-ia64/percpu.h 2007-11-27 17:42:16.396463447 -0800 @@ -18,18 +18,10 @@ # define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__))) #endif -#ifdef CONFIG_SMP - #define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset) extern void *per_cpu_init(void); -#else /* ! SMP */ - -#define per_cpu_init() (__phys_per_cpu_start) - -#endif /* SMP */ - /* * Be extremely careful when taking the address of this variable! Due to virtual * remapping, it is different from the canonical address returned by __get_cpu_var(var)! Index: linux-2.6/include/asm-powerpc/percpu.h =================================================================== --- linux-2.6.orig/include/asm-powerpc/percpu.h 2007-11-27 17:37:22.172212962 -0800 +++ linux-2.6/include/asm-powerpc/percpu.h 2007-11-27 17:42:16.396463447 -0800 @@ -8,14 +8,11 @@ * in the paca. Based on the x86-64 implementation. */ -#ifdef CONFIG_SMP - #include #define __per_cpu_offset(cpu) (paca[cpu].data_offset) #define __my_cpu_offset() get_paca()->data_offset #define per_cpu_offset(x) (__per_cpu_offset(x)) -#endif /* SMP */ #include #endif /* _ASM_POWERPC_PERCPU_H_ */ Index: linux-2.6/include/asm-sparc64/percpu.h =================================================================== --- linux-2.6.orig/include/asm-sparc64/percpu.h 2007-11-27 17:37:23.076463754 -0800 +++ linux-2.6/include/asm-sparc64/percpu.h 2007-11-27 17:42:16.396463447 -0800 @@ -5,8 +5,6 @@ register unsigned long __local_per_cpu_offset asm("g5"); -#ifdef CONFIG_SMP - extern void real_setup_per_cpu_areas(void); extern unsigned long __per_cpu_base; @@ -17,12 +15,6 @@ extern unsigned long __per_cpu_shift; #define __my_cpu_offset __local_per_cpu_offset -#else /* ! SMP */ - -#define real_setup_per_cpu_areas() do { } while (0) - -#endif /* SMP */ - #include #endif /* __ARCH_SPARC64_PERCPU__ */ Index: linux-2.6/init/main.c =================================================================== --- linux-2.6.orig/init/main.c 2007-11-27 17:41:44.821463580 -0800 +++ linux-2.6/init/main.c 2007-11-27 17:42:16.416462861 -0800 @@ -358,10 +358,9 @@ static void __init smp_init(void) #define smp_init() do { } while (0) #endif -static inline void setup_per_cpu_areas(void) { } static inline void smp_prepare_cpus(unsigned int maxcpus) { } -#else +#endif #ifndef CONFIG_ARCH_SETS_UP_PER_CPU_AREA unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; @@ -386,6 +385,7 @@ static void __init setup_per_cpu_areas(v } #endif /* CONFIG_ARCH_SETS_UP_CPU_AREA */ +#ifdef CONFIG_SMP /* Called by boot processor to activate the rest. */ static void __init smp_init(void) {