about summary refs log tree commit diff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/i386/pthread_spin_lock.c15
-rw-r--r--nptl/sysdeps/i386/tls.h10
-rw-r--r--nptl/sysdeps/x86_64/tls.h12
3 files changed, 23 insertions, 14 deletions
diff --git a/nptl/sysdeps/i386/pthread_spin_lock.c b/nptl/sysdeps/i386/pthread_spin_lock.c
index 43a1831131..f001fbacab 100644
--- a/nptl/sysdeps/i386/pthread_spin_lock.c
+++ b/nptl/sysdeps/i386/pthread_spin_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -19,11 +19,12 @@
 
 #include "pthreadP.h"
 
-
-#ifdef UP
-# define LOCK
-#else
-# define LOCK "lock;"
+#ifndef LOCK_PREFIX
+# ifdef UP
+#  define LOCK_PREFIX	/* nothing */
+# else
+#  define LOCK_PREFIX	"lock;"
+# endif
 #endif
 
 
@@ -32,7 +33,7 @@ pthread_spin_lock (lock)
      pthread_spinlock_t *lock;
 {
   asm ("\n"
-       "1:\t" LOCK "decl %0\n\t"
+       "1:\t" LOCK_PREFIX "decl %0\n\t"
        "jne 2f\n\t"
        ".subsection 1\n\t"
        ".align 16\n"
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index 4f2e8180d3..7ee2bcac19 100644
--- a/nptl/sysdeps/i386/tls.h
+++ b/nptl/sysdeps/i386/tls.h
@@ -169,11 +169,11 @@ union user_desc_init
 # define INIT_SYSINFO
 #endif
 
-#ifndef LOCK
+#ifndef LOCK_PREFIX
 # ifdef UP
-#  define LOCK  /* nothing */
+#  define LOCK_PREFIX  /* nothing */
 # else
-#  define LOCK "lock;"
+#  define LOCK_PREFIX "lock;"
 # endif
 #endif
 
@@ -365,7 +365,7 @@ union user_desc_init
   ({ __typeof (descr->member) __ret;					      \
      __typeof (oldval) __old = (oldval);				      \
      if (sizeof (descr->member) == 4)					      \
-       asm volatile (LOCK "cmpxchgl %2, %%gs:%P3"			      \
+       asm volatile (LOCK_PREFIX "cmpxchgl %2, %%gs:%P3"		      \
 		     : "=a" (__ret)					      \
 		     : "0" (__old), "r" (newval),			      \
 		       "i" (offsetof (struct pthread, member)));	      \
@@ -378,7 +378,7 @@ union user_desc_init
 /* Atomic set bit.  */
 #define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
   (void) ({ if (sizeof ((descr)->member) == 4)				      \
-	      asm volatile (LOCK "orl %1, %%gs:%P0"			      \
+	      asm volatile (LOCK_PREFIX "orl %1, %%gs:%P0"		      \
 			    :: "i" (offsetof (struct pthread, member)),	      \
 			       "ir" (1 << (bit)));			      \
 	    else							      \
diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
index 975d20f3fa..ab13f25431 100644
--- a/nptl/sysdeps/x86_64/tls.h
+++ b/nptl/sysdeps/x86_64/tls.h
@@ -67,6 +67,14 @@ typedef struct
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
 
+#ifndef LOCK_PREFIX
+# ifdef UP
+#  define LOCK_PREFIX	/* nothing */
+# else
+#  define LOCK_PREFIX	"lock;"
+# endif
+#endif
+
 /* This is the size of the initial TCB.  */
 # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
 
@@ -267,7 +275,7 @@ typedef struct
   ({ __typeof (descr->member) __ret;					      \
      __typeof (oldval) __old = (oldval);				      \
      if (sizeof (descr->member) == 4)					      \
-       asm volatile (LOCK "cmpxchgl %2, %%fs:%P3"			      \
+       asm volatile (LOCK_PREFIX "cmpxchgl %2, %%fs:%P3"		      \
 		     : "=a" (__ret)					      \
 		     : "0" (__old), "r" (newval),			      \
 		       "i" (offsetof (struct pthread, member)));	      \
@@ -280,7 +288,7 @@ typedef struct
 /* Atomic set bit.  */
 #define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
   (void) ({ if (sizeof ((descr)->member) == 4)				      \
-	      asm volatile (LOCK "orl %1, %%fs:%P0"			      \
+	      asm volatile (LOCK_PREFIX "orl %1, %%fs:%P0"		      \
 			    :: "i" (offsetof (struct pthread, member)),	      \
 			       "ir" (1 << (bit)));			      \
 	    else							      \