re PR libgcj/30513 (Bootstrap failure with libgcj on sparc-sun-solaris2.10)
2007-01-27 Andreas Tobler <a.tobler@schweiz.org> PR libgcj/30513 * configure.host: Add forgottten sysdep_dir to sparc. Add a flag to libgcj_flags to undefine 'sun' at compile time. * sysdep/sparc/locks.h (read_barrier): New functions for 32 and 64 bit Sparc. (write_barrier): Likewise. From-SVN: r121239
This commit is contained in:
parent
024abeb327
commit
4838bfc05b
3 changed files with 43 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
// locks.h - Thread synchronization primitives. Sparc implementation.
|
||||
|
||||
/* Copyright (C) 2002 Free Software Foundation
|
||||
/* Copyright (C) 2002, 2007 Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
|
||||
|
@ -38,12 +38,23 @@ release_set(volatile obj_addr_t *addr, obj_addr_t new_val)
|
|||
}
|
||||
|
||||
inline static bool
|
||||
compare_and_swap_release(volatile obj_addr_t *addr,
|
||||
obj_addr_t old,
|
||||
obj_addr_t new_val)
|
||||
compare_and_swap_release(volatile obj_addr_t *addr, obj_addr_t old,
|
||||
obj_addr_t new_val)
|
||||
{
|
||||
return compare_and_swap(addr, old, new_val);
|
||||
}
|
||||
|
||||
inline static void
|
||||
read_barrier()
|
||||
{
|
||||
__asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory");
|
||||
}
|
||||
|
||||
inline static void
|
||||
write_barrier()
|
||||
{
|
||||
__asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory");
|
||||
}
|
||||
#else
|
||||
/* Sparc32 implementation, use a spinlock. */
|
||||
static unsigned char __cas_lock = 0;
|
||||
|
@ -109,12 +120,23 @@ release_set(volatile obj_addr_t *addr, obj_addr_t new_val)
|
|||
}
|
||||
|
||||
inline static bool
|
||||
compare_and_swap_release(volatile obj_addr_t *addr,
|
||||
obj_addr_t old,
|
||||
obj_addr_t new_val)
|
||||
compare_and_swap_release(volatile obj_addr_t *addr, obj_addr_t old,
|
||||
obj_addr_t new_val)
|
||||
{
|
||||
return compare_and_swap(addr, old, new_val);
|
||||
}
|
||||
|
||||
inline static void
|
||||
read_barrier()
|
||||
{
|
||||
__asm__ __volatile__ ("" : : : "memory");
|
||||
}
|
||||
|
||||
inline static void
|
||||
write_barrier()
|
||||
{
|
||||
__asm__ __volatile__ ("" : : : "memory");
|
||||
}
|
||||
#endif /* __arch64__ */
|
||||
|
||||
#endif /* ! __SYSDEP_LOCKS_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue