diff options
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 | ||