Simplify (and robustify) regular PACKing
[sbcl.git] / src / runtime / ppc-arch.h
index b225869..a5fe1e9 100644 (file)
@@ -32,8 +32,24 @@ release_spinlock(lispobj *word)
     *word=0;
 }
 
+#ifdef LISP_FEATURE_SB_THREAD
+static inline lispobj
+swap_lispobjs(volatile lispobj *dest, lispobj value)
+{
+    lispobj old_value;
+    asm volatile ("1: lwarx %0,0,%1;"
+                  "   stwcx. %2,0,%1;"
+                  "   bne- 1b;"
+                  "   isync"
+         : "=&r" (old_value)
+         : "r" (dest), "r" (value)
+         : "cr0", "memory");
+    return old_value;
+}
+#endif
 
 #define ARCH_HAS_LINK_REGISTER
+#define ALIEN_STACK_GROWS_DOWNWARD
 
 extern void ppc_flush_icache(os_vm_address_t address, os_vm_size_t length);