summaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-08-26 12:04:34 +0200
committerAndreas Schwab <schwab@redhat.com>2009-08-26 12:04:34 +0200
commit19fe1be84e6f775e3a7f4cd03b093338d6a317bf (patch)
tree1d28740af54a3d9194373f7f561baf579c3a8f44 /nptl/sysdeps
parentbc9dd948ffc9cf1992d3e77e753789ab897e3dc6 (diff)
parent2df4be8c3545f6158e468660a73f794573fb6f07 (diff)
Merge commit 'origin/master' into fedora/master
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/x86_64/tls.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
index 4212038ab5..e39eb5f69d 100644
--- a/nptl/sysdeps/x86_64/tls.h
+++ b/nptl/sysdeps/x86_64/tls.h
@@ -188,7 +188,7 @@ typedef struct
The contained asm must *not* be marked volatile since otherwise
assignments like
- pthread_descr self = thread_self();
+ pthread_descr self = thread_self();
do not get optimized away. */
# define THREAD_SELF \
({ struct pthread *__self; \
@@ -404,7 +404,12 @@ extern void _dl_x86_64_restore_sse (void);
# define RTLD_CHECK_FOREIGN_CALL \
(THREAD_GETMEM (THREAD_SELF, header.rtld_must_xmm_save) != 0)
+/* NB: Don't use the xchg operation because that would imply a lock
+ prefix which is expensive and unnecessary. The cache line is also
+ not contested at all. */
# define RTLD_ENABLE_FOREIGN_CALL \
+ int old_rtld_must_xmm_save = THREAD_GETMEM (THREAD_SELF, \
+ header.rtld_must_xmm_save); \
THREAD_SETMEM (THREAD_SELF, header.rtld_must_xmm_save, 1)
# define RTLD_PREPARE_FOREIGN_CALL \
@@ -419,7 +424,8 @@ extern void _dl_x86_64_restore_sse (void);
do { \
if (THREAD_GETMEM (THREAD_SELF, header.rtld_must_xmm_save) == 0) \
_dl_x86_64_restore_sse (); \
- THREAD_SETMEM (THREAD_SELF, header.rtld_must_xmm_save, 0); \
+ THREAD_SETMEM (THREAD_SELF, header.rtld_must_xmm_save, \
+ old_rtld_must_xmm_save); \
} while (0)
# endif