* Boehm-Demers-Weiser conservative garbage collector.
*/
+#ifndef __SIZEOF_LONG__
+#ifdef __powerpc64__
+#define __SIZEOF_LONG__ 8
+#else
+#define __SIZEOF_LONG__ 4
+#endif
+#endif
+
#ifndef BITS_PER_LONG
#define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
#endif
-#define ILLEGAL_INSTR .long 0xd00d00
+#define ILLEGAL_INSTR ".long 0xd00d00"
#ifndef _INCLUDE_API_H
"stwcx. %2,0,%1\n" /* else store conditional */
"bne- 1b\n" /* retry if lost reservation */
"isync\n"
- : "=&r"(result),
+ : "=&r"(result)
: "r"(addr), "r"(val)
: "memory", "cc");
"stdcx. %2,0,%1\n" /* else store conditional */
"bne- 1b\n" /* retry if lost reservation */
"isync\n"
- : "=&r"(result),
+ : "=&r"(result)
: "r"(addr), "r"(val)
: "memory", "cc");
return 0;
}
-#define xchg(addr, v) (__typeof__(*(addr)) _atomic_exchange((addr), (v), \
- sizeof(*(addr))))
+#define xchg(addr, v) (__typeof__(*(addr))) _atomic_exchange((addr), (v), \
+ sizeof(*(addr)))
#endif /* #ifndef _INCLUDE_API_H */