about summary refs log tree commit diff
path: root/REORG.TODO/sysdeps/i386/stackguard-macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/sysdeps/i386/stackguard-macros.h')
-rw-r--r--REORG.TODO/sysdeps/i386/stackguard-macros.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/REORG.TODO/sysdeps/i386/stackguard-macros.h b/REORG.TODO/sysdeps/i386/stackguard-macros.h
new file mode 100644
index 0000000000..039762927c
--- /dev/null
+++ b/REORG.TODO/sysdeps/i386/stackguard-macros.h
@@ -0,0 +1,12 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+  ({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+  ({							\
+     uintptr_t x;					\
+     asm ("movl %%gs:%c1, %0" : "=r" (x)		\
+	  : "i" (offsetof (tcbhead_t, pointer_guard)));	\
+     x;							\
+   })