summaryrefslogtreecommitdiff
path: root/sysdeps/mach/i386
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2008-08-02 20:12:08 +0000
committerRoland McGrath <roland@gnu.org>2008-08-02 20:12:08 +0000
commit4c8ac84562fb039586f0ed91280c7fa79a913029 (patch)
tree65b66a46a262ca60e883b9c0356dd5e9173b481c /sysdeps/mach/i386
parent48b22986ccb7751b8474189ac1b610265b242c30 (diff)
2008-08-02 Roland McGrath <roland@frob.com>
* sysdeps/mach/i386/machine-lock.h (__spin_unlock, __spin_try_lock): Add memory clobbers.
Diffstat (limited to 'sysdeps/mach/i386')
-rw-r--r--sysdeps/mach/i386/machine-lock.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sysdeps/mach/i386/machine-lock.h b/sysdeps/mach/i386/machine-lock.h
index d786628170..ca87647254 100644
--- a/sysdeps/mach/i386/machine-lock.h
+++ b/sysdeps/mach/i386/machine-lock.h
@@ -1,5 +1,5 @@
/* Machine-specific definition for spin locks. i386 version.
- Copyright (C) 1994, 1997, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1994,1997,2007,2008 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
@@ -40,7 +40,8 @@ __spin_unlock (__spin_lock_t *__lock)
{
register int __unlocked;
__asm__ __volatile ("xchgl %0, %1"
- : "=&r" (__unlocked), "=m" (*__lock) : "0" (0));
+ : "=&r" (__unlocked), "=m" (*__lock) : "0" (0)
+ : : "memory");
}
/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */
@@ -50,7 +51,8 @@ __spin_try_lock (__spin_lock_t *__lock)
{
register int __locked;
__asm__ __volatile ("xchgl %0, %1"
- : "=&r" (__locked), "=m" (*__lock) : "0" (1));
+ : "=&r" (__locked), "=m" (*__lock) : "0" (1)
+ : : "memory");
return !__locked;
}