AO_t oldval;
int result = 0;
# if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
- /* FIXME: Completely untested. */
__asm__ __volatile__(
"1:ldarx %0,0,%2\n" /* load and reserve */
"cmpd %0, %4\n" /* if load is not equal to */
AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
{
AO_t fetched_val;
- /* FIXME: Completely untested. */
# if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
__asm__ __volatile__(
"1:ldarx %0,0,%1\n" /* load and reserve */
AO_t oldval;
AO_t newval;
#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
-/* FIXME: Completely untested. */
__asm__ __volatile__(
"1:ldarx %0,0,%2\n" /* load and reserve */
"add %1,%0,%3\n" /* increment */
"stdcx. %1,0,%2\n" /* store conditional */
"bne- 1b\n" /* retry if lost reservation */
: "=&r"(oldval), "=&r"(newval)
- : "r"(addr), "r"(incr)
+ : "r"(addr), "r"(incr)
: "memory", "cr0");
#else
__asm__ __volatile__(
"stwcx. %1,0,%2\n" /* store conditional */
"bne- 1b\n" /* retry if lost reservation */
: "=&r"(oldval), "=&r"(newval)
- : "r"(addr), "r"(incr)
+ : "r"(addr), "r"(incr)
: "memory", "cr0");
#endif
return oldval;