@@ -12,20 +12,18 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#import "objfw-defs.h" +#include + +#import "macros.h" #ifndef OF_HAVE_ATOMIC_OPS # error No atomic operations available! #endif -#include - -#import "macros.h" - #ifdef OF_HAVE_OSATOMIC # include #endif OF_ASSUME_NONNULL_BEGIN @@ -58,11 +56,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "add %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -94,11 +92,11 @@ : "+&r"(i) : "r"(i), "m"(*p) ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "add %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -140,11 +138,11 @@ : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "add %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -195,11 +193,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "sub %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -232,11 +230,11 @@ : "+&r"(i) : "r"(i), "m"(*p) ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "sub %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -280,11 +278,11 @@ : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "sub %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -339,11 +337,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int i; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %1\n\t" @@ -381,11 +379,11 @@ : "=&r"(i) : "m"(*p) ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int32_t i; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %1\n\t" @@ -438,11 +436,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int i; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %1\n\t" @@ -480,11 +478,11 @@ : "=&r"(i) : "m"(*p) ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int32_t i; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %1\n\t" @@ -541,11 +539,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "or %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -582,11 +580,11 @@ : "r"(i), "m"(*p) : "eax", "cc" ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "or %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -641,11 +639,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "and %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -682,11 +680,11 @@ : "r"(i), "m"(*p) : "eax", "cc" ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "and %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -741,11 +739,11 @@ # endif else abort(); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "xor %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -782,11 +780,11 @@ : "r"(i), "m"(*p) : "eax", "cc" ); return i; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %2\n\t" "xor %0, %0, %1\n\t" "stwcx. %0, 0, %2\n\t" @@ -827,11 +825,11 @@ : "r"(n), "m"(*p) : "cc" ); return r; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int r; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %3\n\t" @@ -882,11 +880,11 @@ : "r"(n), "m"(*p) : "cc" ); return r; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int r; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %3\n\t" @@ -938,11 +936,11 @@ : "r"(n), "m"(*p) : "cc" ); return r; -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) int r; __asm__ __volatile__ ( "0:\n\t" "lwarx %0, 0, %3\n\t" @@ -975,11 +973,11 @@ #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "mfence" ); -#elif defined(OF_PPC_ASM) +#elif defined(OF_POWERPC_ASM) __asm__ __volatile__ ( "sync" ); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) __sync_synchronize();