1 #ifndef __INTEL_DEFNS_H__
2 #define __INTEL_DEFNS_H__
12 #define pthread_mutex_init(_m,_i) \
13 ({ pthread_mutex_init(_m,_i); (_m)->__m_kind = PTHREAD_MUTEX_ADAPTIVE_NP; })
25 #define CAS(_a, _o, _n) \
26 ({ __typeof__(_o) __o = _o; \
27 __asm__ __volatile__( \
28 "lock cmpxchg %3,%1" \
29 : "=a" (__o), "=m" (*(volatile unsigned int *)(_a)) \
30 : "0" (__o), "r" (_n) ); \
35 ({ __typeof__(_n) __o; \
36 __asm__ __volatile__( \
38 : "=r" (__o), "=m" (*(volatile unsigned int *)(_a)) \
43 #define CAS64(_a, _o, _n) \
44 ({ __typeof__(_o) __o = _o; \
45 __asm__ __volatile__( \
49 : "=A" (__o), "=m" (*(volatile unsigned long long *)(_a)) \
50 : "0" (__o), "m" (_n >> 32), "m" (_n) \
75 #define MB() __sync_synchronize()
76 #define WMB() __asm__ __volatile__ ("" : : : "memory")
81 #define RMB_NEAR_CAS() WMB()
82 #define WMB_NEAR_CAS() WMB()
83 #define MB_NEAR_CAS() WMB()
95 __asm__ __volatile__(
"rdtsc\n"
111 typedef unsigned char _u8;
114 typedef unsigned long long _u64;
unsigned int _u32
Definition: intel_defns.h:113
unsigned char _u8
Definition: intel_defns.h:111
unsigned short _u16
Definition: intel_defns.h:112
unsigned long long _u64
Definition: intel_defns.h:114
static tick_t __attribute__((always_inline)) RDTICK()
Definition: intel_defns.h:92
unsigned long long tick_t
Definition: intel_defns.h:90