Ignore:
Timestamp:
Jan 25, 2018, 1:00:12 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
dbe9b08
Parents:
f7d6bb0 (diff), b6ec245 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    rf7d6bb0 r6e0f4bd  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Oct 31 15:14:38 2017
    11 // Last Modified By : --
    12 // Last Modified On : --
    13 // Update Count     : 0
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec  8 16:02:22 2017
     13// Update Count     : 1
    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" : : : )
    2628#else
    2729        #error unsupported architecture
    2830#endif
    2931
    30 #if defined( __i386 ) || defined( __x86_64 )
     32#if defined( __i386 ) || defined( __x86_64 ) || defined( __ARM_ARCH )
    3133        // Intel recommendation
    3234        #define __ALIGN__ __attribute__(( aligned (128) ))
     
    3739#endif
    3840
    39 #if defined( __x86_64 )
     41#if __SIZEOF_SIZE_T__ == 8
    4042        #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_8( &(lock), 1 ) == 0
    4143        #define __lock_release( lock ) __sync_lock_release_8( &(lock) );
    42 #elif defined( __i386 )
     44#elif __SIZEOF_SIZE_T__ == 4
    4345        #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_4( &(lock), 1 ) == 0
    4446        #define __lock_release( lock ) __sync_lock_release_4( &(lock) );
     
    4850
    4951struct __spinlock_t {
    50         __ALIGN__ volatile uintptr_t lock;
     52        __ALIGN__ volatile size_t lock;
    5153        #ifdef __CFA_DEBUG__
    5254                const char * prev_name;
Note: See TracChangeset for help on using the changeset viewer.