Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/bits/locks.h

    rb158d8f rc2b9f21  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Oct 31 15:14:38 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec  8 16:02:22 2017
    13 // Update Count     : 1
     11// Last Modified By : --
     12// Last Modified On : --
     13// Update Count     : 0
    1414//
    1515
     
    2424#elif defined( __i386 ) || defined( __x86_64 )
    2525        #define Pause() __asm__ __volatile__ ( "pause" : : : )
    26 #elif defined( __ARM_ARCH )
    27         #define Pause() __asm__ __volatile__ ( "nop" : : : )
    2826#else
    2927        #error unsupported architecture
    3028#endif
    3129
    32 #if defined( __i386 ) || defined( __x86_64 ) || defined( __ARM_ARCH )
     30#if defined( __i386 ) || defined( __x86_64 )
    3331        // Intel recommendation
    3432        #define __ALIGN__ __attribute__(( aligned (128) ))
     
    3937#endif
    4038
    41 #if __SIZEOF_SIZE_T__ == 8
     39#if defined( __x86_64 )
    4240        #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_8( &(lock), 1 ) == 0
    4341        #define __lock_release( lock ) __sync_lock_release_8( &(lock) );
    44 #elif __SIZEOF_SIZE_T__ == 4
     42#elif defined( __i386 )
    4543        #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_4( &(lock), 1 ) == 0
    4644        #define __lock_release( lock ) __sync_lock_release_4( &(lock) );
     
    5048
    5149struct __spinlock_t {
    52         __ALIGN__ volatile size_t lock;
     50        __ALIGN__ volatile uintptr_t lock;
    5351        #ifdef __CFA_DEBUG__
    5452                const char * prev_name;
Note: See TracChangeset for help on using the changeset viewer.