about summary refs log tree commit diff
path: root/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/pthread_arch.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/i386/pthread_arch.h b/arch/i386/pthread_arch.h
new file mode 100644
index 00000000..155b4847
--- /dev/null
+++ b/arch/i386/pthread_arch.h
@@ -0,0 +1,6 @@
+static inline struct pthread *__pthread_self()
+{
+	struct pthread *self;
+	__asm__ ("movl %%gs:0,%0" : "=r" (self) );
+	return self;
+}