X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fppc-arch.h;h=515335f7b52e1cb38ac157643e0c78a233c49b7a;hb=eac461c1f1ca91cfe282c779291d582ed6b336cb;hp=b2258698d8e09e9cbac9f70e3ad44570fcf9d74e;hpb=43a3cc06f2671f6a3e75ae22c17f369e6306b6bb;p=sbcl.git diff --git a/src/runtime/ppc-arch.h b/src/runtime/ppc-arch.h index b225869..515335f 100644 --- a/src/runtime/ppc-arch.h +++ b/src/runtime/ppc-arch.h @@ -32,6 +32,21 @@ 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