X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/b5d655f7532a546b54809da387f7467d128a756b..5f4d86c1219d56604890d932a3152b3b5dd15b55:/ppc/sys/OSAtomic.s diff --git a/ppc/sys/OSAtomic.s b/ppc/sys/OSAtomic.s index 24858e9..8ce3cd1 100644 --- a/ppc/sys/OSAtomic.s +++ b/ppc/sys/OSAtomic.s @@ -36,8 +36,19 @@ /* int32_t OSAtomicAdd32( int32_t theAmount, int32_t *theValue ); */ +#if defined(__ppc__) MI_ENTRY_POINT(_OSAtomicAdd32) ba _COMM_PAGE_ATOMIC_ADD32 +#elif defined(__ppc64__) +MI_ENTRY_POINT(_OSAtomicAdd32) + mflr r12 // save return address + bla _COMM_PAGE_ATOMIC_ADD32 + mtlr r12 + extsw r3,r3 // sign extend return value + blr +#else +#error undefined architecture +#endif /* int32_t OSAtomicOr32( int32_t theMask, int32_t *theValue ); */ @@ -240,7 +251,13 @@ MI_ENTRY_POINT(_OSAtomicAdd32Barrier) cmpwi r3,0 // did swap occur? beq-- 1b // compare-and-swap failed, try again mtlr r12 // restore return adddress +#if defined(__ppc__) mr r3,r4 // return new value +#elif defined(__ppc64__) + extsw r3,r4 // sign extend return value +#else +#error undefined architecture +#endif blr