aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
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 /arch/alpha
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 'arch/alpha')
-rw-r--r--arch/alpha/include/asm/percpu.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h
index 06c5c7a4afd3..b663f1f10b6a 100644
--- a/arch/alpha/include/asm/percpu.h
+++ b/arch/alpha/include/asm/percpu.h
@@ -30,7 +30,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
30 30
31#ifndef MODULE 31#ifndef MODULE
32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset)) 32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
33#define PER_CPU_ATTRIBUTES 33#define PER_CPU_DEF_ATTRIBUTES
34#else 34#else
35/* 35/*
36 * To calculate addresses of locally defined variables, GCC uses 32-bit 36 * To calculate addresses of locally defined variables, GCC uses 32-bit
@@ -49,7 +49,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
49 : "=&r"(__ptr), "=&r"(tmp_gp)); \ 49 : "=&r"(__ptr), "=&r"(tmp_gp)); \
50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); }) 50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); })
51 51
52#define PER_CPU_ATTRIBUTES __used 52#define PER_CPU_DEF_ATTRIBUTES __used
53 53
54#endif /* MODULE */ 54#endif /* MODULE */
55 55
@@ -71,7 +71,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
71#define __get_cpu_var(var) per_cpu_var(var) 71#define __get_cpu_var(var) per_cpu_var(var)
72#define __raw_get_cpu_var(var) per_cpu_var(var) 72#define __raw_get_cpu_var(var) per_cpu_var(var)
73 73
74#define PER_CPU_ATTRIBUTES 74#define PER_CPU_DEF_ATTRIBUTES
75 75
76#endif /* SMP */ 76#endif /* SMP */
77 77