| * Copyright (C) Igor Sysoev |
| * "casa [r1] 0x80, r2, r0" and |
| * "casxa [r1] 0x80, r2, r0" do the following: |
| * so "r0 == r2" means that the operation was successfull. |
| * The "r" means the general register. |
| * The "+r" means the general register used for both input and output. |
| static ngx_inline ngx_atomic_uint_t |
| ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, |
| NGX_CASA " [%1] 0x80, %2, %0" |
| : "+r" (set) : "r" (lock), "r" (old) : "memory"); |
| static ngx_inline ngx_atomic_int_t |
| ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add) |
| ngx_atomic_uint_t old, res; |
| NGX_CASA " [%1] 0x80, %2, %0" |
| : "+r" (res) : "r" (value), "r" (old) : "memory"); |
| #define ngx_memory_barrier() \ |
| "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" \ |
| #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory") |