diff options
Diffstat (limited to 'include/asm-generic/percpu.h')
-rw-r--r-- | include/asm-generic/percpu.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index b0e63c672ebd..d7d50d7ee51e 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -1,13 +1,9 @@ | |||
1 | #ifndef _ASM_GENERIC_PERCPU_H_ | 1 | #ifndef _ASM_GENERIC_PERCPU_H_ |
2 | #define _ASM_GENERIC_PERCPU_H_ | 2 | #define _ASM_GENERIC_PERCPU_H_ |
3 | |||
3 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
4 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
5 | 6 | #include <linux/percpu-defs.h> | |
6 | /* | ||
7 | * Determine the real variable name from the name visible in the | ||
8 | * kernel sources. | ||
9 | */ | ||
10 | #define per_cpu_var(var) per_cpu__##var | ||
11 | 7 | ||
12 | #ifdef CONFIG_SMP | 8 | #ifdef CONFIG_SMP |
13 | 9 | ||
@@ -73,11 +69,32 @@ extern void setup_per_cpu_areas(void); | |||
73 | 69 | ||
74 | #endif /* SMP */ | 70 | #endif /* SMP */ |
75 | 71 | ||
72 | #ifndef PER_CPU_BASE_SECTION | ||
73 | #ifdef CONFIG_SMP | ||
74 | #define PER_CPU_BASE_SECTION ".data.percpu" | ||
75 | #else | ||
76 | #define PER_CPU_BASE_SECTION ".data" | ||
77 | #endif | ||
78 | #endif | ||
79 | |||
80 | #ifdef CONFIG_SMP | ||
81 | |||
82 | #ifdef MODULE | ||
83 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
84 | #else | ||
85 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | ||
86 | #endif | ||
87 | #define PER_CPU_FIRST_SECTION ".first" | ||
88 | |||
89 | #else | ||
90 | |||
91 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
92 | #define PER_CPU_FIRST_SECTION "" | ||
93 | |||
94 | #endif | ||
95 | |||
76 | #ifndef PER_CPU_ATTRIBUTES | 96 | #ifndef PER_CPU_ATTRIBUTES |
77 | #define PER_CPU_ATTRIBUTES | 97 | #define PER_CPU_ATTRIBUTES |
78 | #endif | 98 | #endif |
79 | 99 | ||
80 | #define DECLARE_PER_CPU(type, name) extern PER_CPU_ATTRIBUTES \ | ||
81 | __typeof__(type) per_cpu_var(name) | ||
82 | |||
83 | #endif /* _ASM_GENERIC_PERCPU_H_ */ | 100 | #endif /* _ASM_GENERIC_PERCPU_H_ */ |