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

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

Issue 7785030: Replace #define syscalls cancel machinery. (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Cosmetic change 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
« no previous file with comments | « nptl/pthread_create.c ('k') | nptl/sysdeps/pthread/createthread.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nptl/sysdeps/i386/tls.h
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index 5d7899a6cc067ba57aae4346c51fa047fadb37d5..79539189fab39ebcbd95505f0150db1e8acd31c5 100644
--- a/nptl/sysdeps/i386/tls.h
+++ b/nptl/sysdeps/i386/tls.h
@@ -27,6 +27,20 @@
# include <stdint.h>
# include <stdlib.h>
# include <list.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__
+# define THREAD_SELF \
+ ({ struct pthread *__self; \
+ asm ("movl %%gs:0,%0" : "=r" (__self)); \
+ __self; })
+#endif
# include <sysdep.h>
# include <kernel-features.h>
@@ -222,12 +236,7 @@ union user_desc_init
assignments like
pthread_descr self = thread_self();
do not get optimized away. */
-# ifdef __native_client__
-# define THREAD_SELF \
- ({ struct pthread *__self; \
- asm ("movl %%gs:0,%0" : "=r" (__self)); \
- __self; })
-# else
+#ifndef __native_client__
# define THREAD_SELF \
({ struct pthread *__self; \
asm ("movl %%gs:%c1,%0" : "=r" (__self) \
« no previous file with comments | « nptl/pthread_create.c ('k') | nptl/sysdeps/pthread/createthread.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698