src/atomic/SDL_spinlock.c
changeset 5328 f34a5f9ce9f6
parent 5289 1916a9e9714d
child 5535 96594ac5fd1a
equal deleted inserted replaced
5327:42b3eb7984e1 5328:f34a5f9ce9f6
    60     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
    60     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
    61 
    61 
    62 #elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
    62 #elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
    63     return (__sync_lock_test_and_set(lock, 1) == 0);
    63     return (__sync_lock_test_and_set(lock, 1) == 0);
    64 
    64 
    65 #elif defined(__GNUC__) && defined(__arm__) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__))
    65 #elif defined(__GNUC__) && defined(__arm__) && \
       
    66         (defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \
       
    67          defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__))
    66     int result;
    68     int result;
    67     __asm__ __volatile__ (
    69     __asm__ __volatile__ (
    68         "swp %0, %1, [%2]\n"
    70         "swp %0, %1, [%2]\n"
    69         : "=&r,&r" (result) : "r,0" (1), "r,r" (lock) : "memory");
    71         : "=&r,&r" (result) : "r,0" (1), "r,r" (lock) : "memory");
    70     return (result == 0);
    72     return (result == 0);