summaryrefslogtreecommitdiff
path: root/arch/x86_64/pthread_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/pthread_arch.h')
-rw-r--r--arch/x86_64/pthread_arch.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86_64/pthread_arch.h b/arch/x86_64/pthread_arch.h
new file mode 100644
index 00000000..40d26797
--- /dev/null
+++ b/arch/x86_64/pthread_arch.h
@@ -0,0 +1,6 @@
+static inline struct pthread *__pthread_self()
+{
+ struct pthread *self;
+ __asm__ ("movq %%fs:0,%0" : "=r" (self) );
+ return self;
+}