Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: nptl/sysdeps/x86_64/tls.h

Issue 7785030: Replace #define syscalls cancel machinery. (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Another (hopefully working) fix for glibc-tests Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nptl/sysdeps/x86_64/tls.h
diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
index d9101975ac6e2140b2988c02e09e76b8e0b10231..c5ba828960eb5dd1e7b9d26f68a8851b8e84087e 100644
--- a/nptl/sysdeps/x86_64/tls.h
+++ b/nptl/sysdeps/x86_64/tls.h
@@ -26,6 +26,18 @@
# include <stddef.h>
# include <stdint.h>
# include <stdlib.h>
+/* Return the thread descriptor for the current thread.
+
+ The contained asm must *not* be marked volatile since otherwise
+ assignments like
+ pthread_descr self = thread_self();
+ do not get optimized away.
+
+ We need it before sysdep.h in NaCl for INTERNAL_SYSCALL_gettid_0. */
+#ifdef __native_client__
+void* __nacl_read_tp (void) __attribute__ ((const));
+# define THREAD_SELF ((struct pthread *)__nacl_read_tp ())
+#endif
# include <sysdep.h>
# include <kernel-features.h>
@@ -186,10 +198,7 @@ typedef struct
assignments like
pthread_descr self = thread_self();
do not get optimized away. */
-#ifdef __native_client__
-void* __nacl_read_tp (void) __attribute__ ((const));
-# define THREAD_SELF ((struct pthread *)__nacl_read_tp ())
-#else
+#ifndef __native_client__
# define THREAD_SELF \
({ struct pthread *__self; \
asm ("movq %%fs:%c1,%q0" : "=r" (__self) \

Powered by Google App Engine
This is Rietveld 408576698