summaryrefslogtreecommitdiff
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-03-04 23:04:15 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-04 23:04:15 -0800
commit3d7af07825c07ddb3fbc27245ff01caae7ce764f (patch)
treef151f055c01f6cbf1b4f0b5f6e261ed41f71743b /include/linux/compiler.h
parent09c1076ece2d7abd60356986436cc64c5253eb09 (diff)
[PATCH] per-cpu areas
This is the Richard Henderson-approved, cleaner, brighter per-cpu patch.
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 05205c74bc4c..cd8cca0fef8f 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -13,4 +13,11 @@
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
+/* This macro obfuscates arithmetic on a variable address so that gcc
+ shouldn't recognize the original var, and make assumptions about it */
+ strcpy(s, "xxx"+X) => memcpy(s, "xxx"+X, 4-X) */
+#define RELOC_HIDE(var, off) \
+ ({ __typeof__(&(var)) __ptr; \
+ __asm__ ("" : "=g"(__ptr) : "0"((void *)&(var) + (off))); \
+ *__ptr; })
#endif /* __LINUX_COMPILER_H */