#include <pthread.h>
#include <sched.h>
Go to the source code of this file.
|
typedef unsigned long long | tick_t |
|
typedef unsigned char | _u8 |
|
typedef unsigned short | _u16 |
|
typedef unsigned int | _u32 |
|
typedef unsigned long long | _u64 |
|
#define CAS |
( |
|
_a, |
|
|
|
_o, |
|
|
|
_n |
|
) |
| |
Value:({ __typeof__(_o) __o = _o; \
__asm__ __volatile__( \
"lock cmpxchg %3,%1" \
: "=a" (__o), "=m" (*(volatile unsigned int *)(_a)) \
: "0" (__o), "r" (_n) ); \
__o; \
})
#define CAS64 |
( |
|
_a, |
|
|
|
_o, |
|
|
|
_n |
|
) |
| |
Value:({ __typeof__(_o) __o = _o; \
__asm__ __volatile__( \
"movl %3, %%ecx;" \
"movl %4, %%ebx;" \
"lock cmpxchg8b %1" \
: "=A" (__o), "=m" (*(volatile unsigned long long *)(_a)) \
: "0" (__o), "m" (_n >> 32), "m" (_n) \
: "ebx", "ecx" ); \
__o; \
})
Value:({ __typeof__(_n) __o; \
__asm__ __volatile__( \
"lock xchg %0,%1" \
: "=r" (__o), "=m" (*(volatile unsigned int *)(_a)) \
: "0" (_n) ); \
__o; \
})
#define MB_NEAR_CAS |
( |
| ) |
WMB() |
#define RMB_NEAR_CAS |
( |
| ) |
WMB() |
#define VOLATILE /*volatile*/ |
#define WMB |
( |
| ) |
__asm__ __volatile__ ("" : : : "memory") |
#define WMB_NEAR_CAS |
( |
| ) |
WMB() |
typedef unsigned short _u16 |
typedef unsigned int _u32 |
typedef unsigned long long _u64 |
typedef unsigned char _u8 |
typedef unsigned long long tick_t |
static tick_t __attribute__ |
( |
(always_inline) |
| ) |
|
|
inlinestatic |