From 73bff0644500d63d67e70d753784bbc83525b938 Mon Sep 17 00:00:00 2001 From: Bo Thorsen Date: Tue, 1 Oct 2002 09:02:08 +0000 Subject: [PATCH] locks.h (compare_and_swap): Fix multilib support. 2002-09-30 Bo Thorsen * sysdep/x86-64/locks.h (compare_and_swap): Fix multilib support. From-SVN: r57682 --- libjava/ChangeLog | 4 ++++ libjava/sysdep/x86-64/locks.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 8c2ab3e243a..eef5d761cb7 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2002-09-30 Bo Thorsen + + * sysdep/x86-64/locks.h (compare_and_swap): Fix multilib support. + 2002-09-30 Tom Tromey * java/io/ObjectInputStream.java (resolveProxyClass): New method diff --git a/libjava/sysdep/x86-64/locks.h b/libjava/sysdep/x86-64/locks.h index cb6be85951b..bad6de6dc6f 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; }