aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2006-09-26 02:30:53 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:44 -0400
commit632bbfeee4f042c05bc65150b4433a297d3fe387 (patch)
treece67b5fa4bec38610fc0ecb9b20be6aa69763bb3 /include/asm-s390
parent0a2966b48fb784e437520e400ddc94874ddbd4e8 (diff)
[PATCH] trigger a syntax error if percpu macros are incorrectly used
get_cpu_var()/per_cpu()/__get_cpu_var() arguments must be simple identifiers. Otherwise the arch dependent implementations might break. This patch enforces the correct usage of the macros by producing a syntax error if the variable is not a simple identifier. Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/percpu.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 28b3517e787c..495ad99c7635 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -15,18 +15,20 @@
15 */ 15 */
16#if defined(__s390x__) && defined(MODULE) 16#if defined(__s390x__) && defined(MODULE)
17 17
18#define __reloc_hide(var,offset) \ 18#define __reloc_hide(var,offset) (*({ \
19 (*({ unsigned long *__ptr; \ 19 extern int simple_indentifier_##var(void); \
20 asm ( "larl %0,per_cpu__"#var"@GOTENT" \ 20 unsigned long *__ptr; \
21 : "=a" (__ptr) : "X" (per_cpu__##var) ); \ 21 asm ( "larl %0,per_cpu__"#var"@GOTENT" \
22 (typeof(&per_cpu__##var))((*__ptr) + (offset)); })) 22 : "=a" (__ptr) : "X" (per_cpu__##var) ); \
23 (typeof(&per_cpu__##var))((*__ptr) + (offset)); }))
23 24
24#else 25#else
25 26
26#define __reloc_hide(var, offset) \ 27#define __reloc_hide(var, offset) (*({ \
27 (*({ unsigned long __ptr; \ 28 extern int simple_indentifier_##var(void); \
28 asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \ 29 unsigned long __ptr; \
29 (typeof(&per_cpu__##var)) (__ptr + (offset)); })) 30 asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \
31 (typeof(&per_cpu__##var)) (__ptr + (offset)); }))
30 32
31#endif 33#endif
32 34