38 #ifndef included_clib_smp_h 39 #define included_clib_smp_h 44 #define clib_smp_compare_and_swap(addr,new,old) __sync_val_compare_and_swap(addr,old,new) 45 #define clib_smp_swap(addr,new) __sync_lock_test_and_set(addr,new) 46 #define clib_smp_atomic_add(addr,increment) __sync_fetch_and_add(addr,increment) 48 #if defined (i386) || defined (__x86_64__) 49 #define clib_smp_pause() do { asm volatile ("pause"); } while (0) 50 #elif defined (__aarch64__) || defined (__arm__) 51 #define clib_smp_pause() do { asm volatile ("isb" ::: "memory"); } while (0) 54 #ifndef clib_smp_pause 55 #define clib_smp_pause() do { } while (0) static void os_sched_yield(void)