aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/x86_64
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-27 21:55:49 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-27 21:55:49 +0000
commitd5c157a978000970befcfa067410896fe08a3dcc (patch)
tree68b2f08ad5abd548bd2103047a431cca164937d3 /nptl/sysdeps/x86_64
parent6284c9f61e25a6f259d25b21b5c0ca223a3e8012 (diff)
downloadglibc-d5c157a978000970befcfa067410896fe08a3dcc.zip
glibc-d5c157a978000970befcfa067410896fe08a3dcc.tar.gz
glibc-d5c157a978000970befcfa067410896fe08a3dcc.tar.bz2
* cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
is available. * libc-cancellation.c (__libc_disable_asynccancel): Likewise. * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND. * sysdeps/i386/tls.h: Likewise. (tcbhead_t): Add __private_tm member.
Diffstat (limited to 'nptl/sysdeps/x86_64')
-rw-r--r--nptl/sysdeps/x86_64/tls.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
index 172f445..ea89f3b 100644
--- a/nptl/sysdeps/x86_64/tls.h
+++ b/nptl/sysdeps/x86_64/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/x86_64 version.
- Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -312,6 +312,17 @@ typedef struct
__ret; })
+/* Atomic logical and. */
+#define THREAD_ATOMIC_AND(descr, member, val) \
+ (void) ({ if (sizeof ((descr)->member) == 4) \
+ asm volatile (LOCK_PREFIX "andl %1, %%fs:%P0" \
+ :: "i" (offsetof (struct pthread, member)), \
+ "ir" (val)); \
+ else \
+ /* Not necessary for other sizes in the moment. */ \
+ abort (); })
+
+
/* Atomic set bit. */
#define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
(void) ({ if (sizeof ((descr)->member) == 4) \