CMGDK r49-rc2
|
宏定义 | |
#define | MY_ATOMIC_MODE "gcc-x86" LOCK_prefix |
#define | asm __asm__ |
#define | make_atomic_add_body(S) asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a)) |
#define | make_atomic_fas_body(S) asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a)) |
#define | make_atomic_cas_body(S) |
#define | make_atomic_load_body(S) |
#define | make_atomic_store_body(S) asm volatile ("; xchg %0, %1;" : "+m" (*a), "+r" (v)) |
#define asm __asm__ |
#define make_atomic_add_body | ( | S | ) | asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a)) |
#define make_atomic_cas_body | ( | S | ) |
asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \ : "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set))
#define make_atomic_fas_body | ( | S | ) | asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a)) |
#define make_atomic_load_body | ( | S | ) |
ret=0; \ asm volatile (LOCK_prefix "; cmpxchg %2, %0" \ : "+m" (*a), "+a" (ret): "r" (ret))
#define make_atomic_store_body | ( | S | ) | asm volatile ("; xchg %0, %1;" : "+m" (*a), "+r" (v)) |
#define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix |