49 inline bool iCAS(
volatile uint32_t *ptr, uint32_t oldVal, uint32_t newVal)
51 unsigned long res = 0;
53 __asm__ __volatile__(
"lock cmpxchgl %1, %2;" 58 :
"r"(newVal),
"m"(*ptr),
"a"(oldVal),
"0"(res)
75 __asm__ __volatile__(
"lock bts $0, %1;\n\t" 92 __asm__ __volatile__(
"lock incl %0" 105 __asm__ __volatile__(
"lock decl %0" 122 __asm__ __volatile__(
"lock incl %0\n\t" 124 :
"=m"(v->
count),
"=qm"(c)
137 __asm__ __volatile__(
"1:\n\t" "movl $1,%%eax\n\t" 138 "lock xchgl %%eax, %0\n\t" 139 "testl %%eax, %%eax\n\t" 163 __asm__ __volatile__(
"mov $0, %%eax\n\t" 164 "lock xchgl %%eax, %0" volatile int count
Atomic counter. Use the provided API to ensure atomicity.
Dynamic Memory Logger and Restorer (DyMeLoR)
int atomic_test_and_set(int *b)
void atomic_dec(atomic_t *v)
void spin_unlock(spinlock_t *s)
void spin_lock(spinlock_t *s)
bool iCAS(volatile uint32_t *ptr, uint32_t oldVal, uint32_t newVal)
bool spin_trylock(spinlock_t *s)
int atomic_inc_and_test(atomic_t *v)
volatile unsigned int lock
The lock guard.
void atomic_inc(atomic_t *v)