aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/percpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/percpu.h')
-rw-r--r--include/asm-generic/percpu.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index d984a9041436..d85172e9ed45 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -14,6 +14,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
14#define DEFINE_PER_CPU(type, name) \ 14#define DEFINE_PER_CPU(type, name) \
15 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 15 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
16 16
17#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
18 __attribute__((__section__(".data.percpu.shared_aligned"))) \
19 __typeof__(type) per_cpu__##name \
20 ____cacheline_aligned_in_smp
21
17/* var is in discarded region: offset to particular copy we want */ 22/* var is in discarded region: offset to particular copy we want */
18#define per_cpu(var, cpu) (*({ \ 23#define per_cpu(var, cpu) (*({ \
19 extern int simple_identifier_##var(void); \ 24 extern int simple_identifier_##var(void); \
@@ -34,6 +39,9 @@ do { \
34#define DEFINE_PER_CPU(type, name) \ 39#define DEFINE_PER_CPU(type, name) \
35 __typeof__(type) per_cpu__##name 40 __typeof__(type) per_cpu__##name
36 41
42#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
43 DEFINE_PER_CPU(type, name)
44
37#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 45#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
38#define __get_cpu_var(var) per_cpu__##var 46#define __get_cpu_var(var) per_cpu__##var
39#define __raw_get_cpu_var(var) per_cpu__##var 47#define __raw_get_cpu_var(var) per_cpu__##var