diff options
author | Bo Thorsen <bo@suse.de> | 2002-10-01 09:02:08 +0000 |
---|---|---|
committer | Bo Thorsen <bo@gcc.gnu.org> | 2002-10-01 11:02:08 +0200 |
commit | 73bff0644500d63d67e70d753784bbc83525b938 (patch) | |
tree | 389bd16319910ee06d97fbe3bfaa98ef4c6079de /libjava | |
parent | fac3fa281dd4f1842ee804ef525cda568872ae45 (diff) | |
download | gcc-73bff0644500d63d67e70d753784bbc83525b938.zip gcc-73bff0644500d63d67e70d753784bbc83525b938.tar.gz gcc-73bff0644500d63d67e70d753784bbc83525b938.tar.bz2 |
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
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/sysdep/x86-64/locks.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 8c2ab3e..eef5d76 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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 diff --git a/libjava/sysdep/x86-64/locks.h b/libjava/sysdep/x86-64/locks.h index cb6be85..bad6de6 100644 --- a/libjava/sysdep/x86-64/locks.h +++ b/libjava/sysdep/x86-64/locks.h @@ -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; } |