diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/percpu.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/percpu.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/percpu.h | 1 | ||||
-rw-r--r-- | include/asm-s390/percpu.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/percpu.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/percpu.h | 2 |
6 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index c74521157461..e160e04290fb 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | extern unsigned long __per_cpu_offset[NR_CPUS]; | 8 | extern unsigned long __per_cpu_offset[NR_CPUS]; |
9 | 9 | ||
10 | #define per_cpu_offset(x) (__per_cpu_offset[x]) | ||
11 | |||
10 | /* Separate out the type, so (int[3], foo) works. */ | 12 | /* Separate out the type, so (int[3], foo) works. */ |
11 | #define DEFINE_PER_CPU(type, name) \ | 13 | #define DEFINE_PER_CPU(type, name) \ |
12 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name | 14 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name |
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h index 24d898b650c5..fbe5cf3ab8dc 100644 --- a/include/asm-ia64/percpu.h +++ b/include/asm-ia64/percpu.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #ifdef CONFIG_SMP | 36 | #ifdef CONFIG_SMP |
37 | 37 | ||
38 | extern unsigned long __per_cpu_offset[NR_CPUS]; | 38 | extern unsigned long __per_cpu_offset[NR_CPUS]; |
39 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
39 | 40 | ||
40 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ | 41 | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ |
41 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | 42 | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); |
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index faa1fc703053..2f2e3024fa61 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #define __per_cpu_offset(cpu) (paca[cpu].data_offset) | 15 | #define __per_cpu_offset(cpu) (paca[cpu].data_offset) |
16 | #define __my_cpu_offset() get_paca()->data_offset | 16 | #define __my_cpu_offset() get_paca()->data_offset |
17 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
17 | 18 | ||
18 | /* Separate out the type, so (int[3], foo) works. */ | 19 | /* Separate out the type, so (int[3], foo) works. */ |
19 | #define DEFINE_PER_CPU(type, name) \ | 20 | #define DEFINE_PER_CPU(type, name) \ |
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h index d9a8cca9b653..28b3517e787c 100644 --- a/include/asm-s390/percpu.h +++ b/include/asm-s390/percpu.h | |||
@@ -42,6 +42,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
42 | #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) | 42 | #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) |
43 | #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) | 43 | #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) |
44 | #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) | 44 | #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) |
45 | #define per_cpu_offset(x) (__per_cpu_offset[x]) | ||
45 | 46 | ||
46 | /* A macro to avoid #include hell... */ | 47 | /* A macro to avoid #include hell... */ |
47 | #define percpu_modcopy(pcpudst, src, size) \ | 48 | #define percpu_modcopy(pcpudst, src, size) \ |
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h index a6ece06b83db..ced8cbde046d 100644 --- a/include/asm-sparc64/percpu.h +++ b/include/asm-sparc64/percpu.h | |||
@@ -11,6 +11,7 @@ extern unsigned long __per_cpu_base; | |||
11 | extern unsigned long __per_cpu_shift; | 11 | extern unsigned long __per_cpu_shift; |
12 | #define __per_cpu_offset(__cpu) \ | 12 | #define __per_cpu_offset(__cpu) \ |
13 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) | 13 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) |
14 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
14 | 15 | ||
15 | /* Separate out the type, so (int[3], foo) works. */ | 16 | /* Separate out the type, so (int[3], foo) works. */ |
16 | #define DEFINE_PER_CPU(type, name) \ | 17 | #define DEFINE_PER_CPU(type, name) \ |
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 549eb929b2c0..08dd9f9dda81 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) | 14 | #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) |
15 | #define __my_cpu_offset() read_pda(data_offset) | 15 | #define __my_cpu_offset() read_pda(data_offset) |
16 | 16 | ||
17 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
18 | |||
17 | /* Separate out the type, so (int[3], foo) works. */ | 19 | /* Separate out the type, so (int[3], foo) works. */ |
18 | #define DEFINE_PER_CPU(type, name) \ | 20 | #define DEFINE_PER_CPU(type, name) \ |
19 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name | 21 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name |