diff options
author | travis@sgi.com <travis@sgi.com> | 2008-01-30 17:27:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 17:27:58 -0500 |
commit | 05991bef104051d47e2160ee9499186aff7da5ad (patch) | |
tree | ff6b00b2d407acd0b743d4272f4577e97e09c823 /include/asm-ia64/percpu.h | |
parent | 3afc620229ccc8214ef96fd0e7db26d79f788167 (diff) |
ia64: use generic percpu
ia64 has a special processor specific mapping that can be used to locate the
offset for the current per cpu area.
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-ia64/percpu.h')
-rw-r--r-- | include/asm-ia64/percpu.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h index 7ef684220cf7..26404b77f007 100644 --- a/include/asm-ia64/percpu.h +++ b/include/asm-ia64/percpu.h | |||
@@ -19,29 +19,14 @@ | |||
19 | # define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__))) | 19 | # define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__))) |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #define DECLARE_PER_CPU(type, name) \ | ||
23 | extern PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | ||
24 | |||
25 | #ifdef CONFIG_SMP | 22 | #ifdef CONFIG_SMP |
26 | 23 | ||
27 | extern unsigned long __per_cpu_offset[NR_CPUS]; | 24 | #define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset) |
28 | #define per_cpu_offset(x) (__per_cpu_offset[x]) | ||
29 | |||
30 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ | ||
31 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | ||
32 | |||
33 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) | ||
34 | #define __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))) | ||
36 | 25 | ||
37 | extern void setup_per_cpu_areas (void); | ||
38 | extern void *per_cpu_init(void); | 26 | extern void *per_cpu_init(void); |
39 | 27 | ||
40 | #else /* ! SMP */ | 28 | #else /* ! SMP */ |
41 | 29 | ||
42 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) | ||
43 | #define __get_cpu_var(var) per_cpu__##var | ||
44 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
45 | #define per_cpu_init() (__phys_per_cpu_start) | 30 | #define per_cpu_init() (__phys_per_cpu_start) |
46 | 31 | ||
47 | #endif /* SMP */ | 32 | #endif /* SMP */ |
@@ -52,7 +37,12 @@ extern void *per_cpu_init(void); | |||
52 | * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly | 37 | * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly |
53 | * more efficient. | 38 | * more efficient. |
54 | */ | 39 | */ |
55 | #define __ia64_per_cpu_var(var) (per_cpu__##var) | 40 | #define __ia64_per_cpu_var(var) per_cpu__##var |
41 | |||
42 | #include <asm-generic/percpu.h> | ||
43 | |||
44 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ | ||
45 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | ||
56 | 46 | ||
57 | #endif /* !__ASSEMBLY__ */ | 47 | #endif /* !__ASSEMBLY__ */ |
58 | 48 | ||