+2008-11-18 Mark Probst <mark.probst@gmail.com>
+
+ * include/private/gc_locks.h (test_and_set): The PPC64 case is
+ wrong, as it operates on 64 bit values, not on 32 bit ones as the
+ function requires. The PPC32 case is sufficient.
+
2008-09-29 Geoff Norton <gnorton@novell.com>
* include/private/gcconfig.h: Make Darwin/ARM use mmap() instead of
# define GC_TEST_AND_SET_DEFINED
# endif
# if defined(POWERPC)
-# if CPP_WORDSZ == 64
- inline static int GC_test_and_set(volatile unsigned int *addr) {
- unsigned long oldval;
- unsigned long temp = 1; /* locked value */
-
- __asm__ __volatile__(
- "1:\tldarx %0,0,%3\n" /* load and reserve */
- "\tcmpdi %0, 0\n" /* if load is */
- "\tbne 2f\n" /* non-zero, return already set */
- "\tstdcx. %2,0,%1\n" /* else store conditional */
- "\tbne- 1b\n" /* retry if lost reservation */
- "\tsync\n" /* import barrier */
- "2:\t\n" /* oldval is zero if we set */
- : "=&r"(oldval), "=p"(addr)
- : "r"(temp), "1"(addr)
- : "cr0","memory");
- return (int)oldval;
- }
-# else
inline static int GC_test_and_set(volatile unsigned int *addr) {
int oldval;
int temp = 1; /* locked value */
: "cr0","memory");
return oldval;
}
-# endif
# define GC_TEST_AND_SET_DEFINED
inline static void GC_clear(volatile unsigned int *addr) {
__asm__ __volatile__("lwsync" : : : "memory");