alpha: fix percpu build breakage
commit6006f5048e1a766e7a1ca012d7f17f061b2e8dfe
authorTejun Heo <tj@kernel.org>
Tue, 30 Jun 2009 18:41:18 +0000 (30 11:41 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Jul 2009 03:38:51 +0000 (19 20:38 -0700)
tree8f2cd68948333f423f2bac9a2a8487075dc91c90
parentd2573f681a0c1c1928ce3dc32c0c069818990990
alpha: fix percpu build breakage

commit b01e8dc34379f4ba2f454390e340a025edbaaa7e upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/alpha/include/asm/percpu.h
include/asm-generic/percpu.h
include/linux/percpu-defs.h