aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-06-30 14:41:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-30 21:55:59 -0400
commitb01e8dc34379f4ba2f454390e340a025edbaaa7e (patch)
tree8498a81a819180b7308e2dcbc4d078b45898ccdf /include
parent15e3252464432a29c5461325cb5243471bd2a219 (diff)
alpha: fix percpu build breakage
alpha percpu access requires custom SHIFT_PERCPU_PTR() definition for modules to work around addressing range limitation. This is done via generating inline assembly using C preprocessing which forces the assembler to generate external reference. This happens behind the compiler's back and makes the compiler think that static percpu variables in modules are unused. This used to be worked around by using __unused attribute for percpu variables which prevent the compiler from omitting the variable; however, recent declare/definition attribute unification change broke this as __used can't be used for declaration. Also, in the process, PER_CPU_ATTRIBUTES definition in alpha percpu.h got broken. This patch adds PER_CPU_DEF_ATTRIBUTES which is only used for definitions and make alpha use it to add __used for percpu variables in modules. This also fixes the PER_CPU_ATTRIBUTES double definition bug. Signed-off-by: Tejun Heo <tj@kernel.org> Tested-by: maximilian attems <max@stro.at> Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Richard Henderson <rth@twiddle.net> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/percpu.h4
-rw-r--r--include/linux/percpu-defs.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index d7d50d7ee51e..aa00800adacc 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -97,4 +97,8 @@ extern void setup_per_cpu_areas(void);
97#define PER_CPU_ATTRIBUTES 97#define PER_CPU_ATTRIBUTES
98#endif 98#endif
99 99
100#ifndef PER_CPU_DEF_ATTRIBUTES
101#define PER_CPU_DEF_ATTRIBUTES
102#endif
103
100#endif /* _ASM_GENERIC_PERCPU_H_ */ 104#endif /* _ASM_GENERIC_PERCPU_H_ */
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 8f921d74f49f..68438e18fff4 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -24,7 +24,8 @@
24 24
25#define DEFINE_PER_CPU_SECTION(type, name, section) \ 25#define DEFINE_PER_CPU_SECTION(type, name, section) \
26 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ 26 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \
27 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 27 PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \
28 __typeof__(type) per_cpu__##name
28 29
29/* 30/*
30 * Variant on the per-CPU variable declaration/definition theme used for 31 * Variant on the per-CPU variable declaration/definition theme used for