Commit 0af8a5cc authored by travis@sgi.com's avatar travis@sgi.com Committed by Ingo Molnar

x86_32: use generic percpu.h

x86_32 only provides a special way to obtain the local per cpu area offset
via x86_read_percpu. Otherwise it can fully use the generic handling.

Cc: ak@suse.de
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent acdac872
...@@ -42,26 +42,7 @@ ...@@ -42,26 +42,7 @@
*/ */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* This is used for other cpus to find our section. */ #define __my_cpu_offset x86_read_percpu(this_cpu_off)
extern unsigned long __per_cpu_offset[];
#define per_cpu_offset(x) (__per_cpu_offset[x])
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
/* We can use this directly for local CPU (faster). */
DECLARE_PER_CPU(unsigned long, this_cpu_off);
/* var is in discarded region: offset to particular copy we want */
#define per_cpu(var, cpu) (*({ \
extern int simple_indentifier_##var(void); \
RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]); }))
#define __raw_get_cpu_var(var) (*({ \
extern int simple_indentifier_##var(void); \
RELOC_HIDE(&per_cpu__##var, x86_read_percpu(this_cpu_off)); \
}))
#define __get_cpu_var(var) __raw_get_cpu_var(var)
/* A macro to avoid #include hell... */ /* A macro to avoid #include hell... */
#define percpu_modcopy(pcpudst, src, size) \ #define percpu_modcopy(pcpudst, src, size) \
...@@ -74,11 +55,18 @@ do { \ ...@@ -74,11 +55,18 @@ do { \
/* fs segment starts at (positive) offset == __per_cpu_offset[cpu] */ /* fs segment starts at (positive) offset == __per_cpu_offset[cpu] */
#define __percpu_seg "%%fs:" #define __percpu_seg "%%fs:"
#else /* !SMP */ #else /* !SMP */
#include <asm-generic/percpu.h>
#define __percpu_seg "" #define __percpu_seg ""
#endif /* SMP */ #endif /* SMP */
#include <asm-generic/percpu.h>
/* We can use this directly for local CPU (faster). */
DECLARE_PER_CPU(unsigned long, this_cpu_off);
/* For arch-specific code, we can use direct single-insn ops (they /* For arch-specific code, we can use direct single-insn ops (they
* don't give an lvalue though). */ * don't give an lvalue though). */
extern void __bad_percpu_size(void); extern void __bad_percpu_size(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment