locks.h (compare_and_swap): Fix multilib support.

2002-09-30  Bo Thorsen  <bo@suse.de>

	* sysdep/x86-64/locks.h (compare_and_swap): Fix multilib support.

From-SVN: r57682
This commit is contained in:
Bo Thorsen 2002-10-01 09:02:08 +00:00 committed by Bo Thorsen
parent fac3fa281d
commit 73bff06445
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2002-09-30 Bo Thorsen <bo@suse.de>
* sysdep/x86-64/locks.h (compare_and_swap): Fix multilib support.
2002-09-30 Tom Tromey <tromey@redhat.com>
* java/io/ObjectInputStream.java (resolveProxyClass): New method

View File

@ -24,10 +24,17 @@ inline static bool
compare_and_swap(volatile obj_addr_t *addr, obj_addr_t old, obj_addr_t new_val)
{
char result;
#ifdef __x86_64__
__asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1"
: "+m"(*(addr)), "=q"(result)
: "r" (new_val), "a"(old)
: "memory");
#else
__asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
: "+m"(*(addr)), "=q"(result)
: "r" (new_val), "a"(old)
: "memory");
#endif
return (bool) result;
}