aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortravis@sgi.com <travis@sgi.com>2008-01-30 17:27:58 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 17:27:58 -0500
commit6ddfee0e79e141550376177b355d6c90ba6da88c (patch)
treeed19ac446e1e4510712b87ee5dae4d6492324939
parent914c82694cadbab511f2aee8a59c89be2938bace (diff)
modules: fold percpu_modcopy into module.c
percpu_modcopy() is defined multiple times in arch files. However, the only user is module.c. Put a static definition into module.c and remove the definitions from the arch files. Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/ia64/kernel/module.c11
-rw-r--r--include/asm-ia64/percpu.h5
-rw-r--r--include/asm-powerpc/percpu.h9
-rw-r--r--include/asm-s390/percpu.h9
4 files changed, 0 insertions, 34 deletions
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index e699eb6c44be..e58f4367cf11 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -940,14 +940,3 @@ module_arch_cleanup (struct module *mod)
940 if (mod->arch.core_unw_table) 940 if (mod->arch.core_unw_table)
941 unw_remove_unwind_table(mod->arch.core_unw_table); 941 unw_remove_unwind_table(mod->arch.core_unw_table);
942} 942}
943
944#ifdef CONFIG_SMP
945void
946percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
947{
948 unsigned int i;
949 for_each_possible_cpu(i) {
950 memcpy(pcpudst + per_cpu_offset(i), src, size);
951 }
952}
953#endif /* CONFIG_SMP */
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index 0095bcf79848..7ef684220cf7 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -22,10 +22,6 @@
22#define DECLARE_PER_CPU(type, name) \ 22#define DECLARE_PER_CPU(type, name) \
23 extern PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 23 extern PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
24 24
25/*
26 * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
27 * external routine, to avoid include-hell.
28 */
29#ifdef CONFIG_SMP 25#ifdef CONFIG_SMP
30 26
31extern unsigned long __per_cpu_offset[NR_CPUS]; 27extern unsigned long __per_cpu_offset[NR_CPUS];
@@ -38,7 +34,6 @@ DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
38#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) 34#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
39#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) 35#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
40 36
41extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size);
42extern void setup_per_cpu_areas (void); 37extern void setup_per_cpu_areas (void);
43extern void *per_cpu_init(void); 38extern void *per_cpu_init(void);
44 39
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index cc1cbf656b02..1b7568838b43 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -21,15 +21,6 @@
21#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 21#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
22#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset)) 22#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset))
23 23
24/* A macro to avoid #include hell... */
25#define percpu_modcopy(pcpudst, src, size) \
26do { \
27 unsigned int __i; \
28 for_each_possible_cpu(__i) \
29 memcpy((pcpudst)+__per_cpu_offset(__i), \
30 (src), (size)); \
31} while (0)
32
33extern void setup_per_cpu_areas(void); 24extern void setup_per_cpu_areas(void);
34 25
35#else /* ! SMP */ 26#else /* ! SMP */
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 2d676a873858..465d313ba2dc 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -39,15 +39,6 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
39#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) 39#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
40#define per_cpu_offset(x) (__per_cpu_offset[x]) 40#define per_cpu_offset(x) (__per_cpu_offset[x])
41 41
42/* A macro to avoid #include hell... */
43#define percpu_modcopy(pcpudst, src, size) \
44do { \
45 unsigned int __i; \
46 for_each_possible_cpu(__i) \
47 memcpy((pcpudst)+__per_cpu_offset[__i], \
48 (src), (size)); \
49} while (0)
50
51#else /* ! SMP */ 42#else /* ! SMP */
52 43
53#define __get_cpu_var(var) __reloc_hide(var,0) 44#define __get_cpu_var(var) __reloc_hide(var,0)