| ATOMIC64_OPS(add, add): | |||||
atomic64_add | ATOMIC64_OP(add, add) |
|
|
|
|
|
atomic64_add_return | ATOMIC64_OP_RETURN(, | dmb ish, | , | l, | “memory”, | add, add) |
| #define ATOMIC64_FETCH_OP(name, mb, acq, rel, cl, op, asm_op) \ long atomic64_fetch_##op##name(long i, atomic64_t *v) \ { \ long result, val; \ unsigned long tmp; \ \ asm volatile("// atomic64_fetch_" #op #name "\n" \ " prfm pstl1strm, %3\n" \ "1: ld" #acq "xr %0, %3\n" \ " " #asm_op " %1, %0, %4\n" \ " st" #rel "xr %w2, %1, %3\n" \ " cbnz %w2, 1b\n" \ " " #mb \ : "=&r" (result), "=&r" (val), "=&r" (tmp), "+Q" (v->counter) \ : "Ir" (i) \ : cl); \ \ return result; \ } | |||||
atomic64_add_return_relaxed | ATOMIC64_OP_RETURN(_relaxed, | , | , | , | , | add, add) |
atomic64_add_return_acquire | ATOMIC64_OP_RETURN(_acquire, | , | a, | , | “memory”, | add, add) |
atomic64_add_return_release | ATOMIC64_OP_RETURN(_release, | , | , | l, | “memory”, | add, add) |
atomic64_fetch_add | ATOMIC64_FETCH_OP(, | dmb ish, | , | l, | “memory”, | add, add) |
atomic64_fetch_add_relaxed | ATOMIC64_FETCH_OP(_relaxed, | , | , | , | , | add, add) |
atomic64_fetch_add_acquire | ATOMIC64_FETCH_OP(_acquire, | , | a, | , | “memory”, | add, add) |
atomic64_fetch_add_release | ATOMIC64_FETCH_OP(_release, | , | , | l, | “memory”, | add, add) |