Print this page
5042 stop using deprecated atomic functions
@@ -693,11 +693,11 @@
\
do { \
_p = node_tp; \
if ((_np = _p + 1) == &node_tv[NODE_TV_SZ]) \
_np = node_tv; \
- } while (casptr(&node_tp, _p, _np) != _p); \
+ } while (atomic_cas_ptr(&node_tp, _p, _np) != _p); \
_p->node = (p); \
_p->action = (a); \
_p->ref = (p) ? (p)->ref : 0; \
_p->cnt = (p) ? (p)->cnt : 0; \
_p->cpu = CPU->cpu_seqid; \
@@ -783,11 +783,11 @@
\
do { \
_p = door_tp; \
if ((_np = _p + 1) == &door_tv[DOOR_TV_SZ]) \
_np = door_tv; \
- } while (casptr(&door_tp, _p, _np) != _p); \
+ } while (atomic_cas_ptr(&door_tp, _p, _np) != _p); \
_p->cp = _cp; \
_p->np = _req_np; \
_p->action = (a); \
_p->ref = _req_np ? _req_np->ref : 0; \
if ((io)) { \
@@ -985,11 +985,11 @@
if (old & DCB_COUNT_USELOCK) { \
readers += old & DCB_COUNT_MASK; \
continue; \
} \
new = old | DCB_COUNT_USELOCK; \
- while (cas32(rp, old, new) != old) { \
+ while (atomic_cas_32(rp, old, new) != old) { \
old = *rp; \
new = old | DCB_COUNT_USELOCK; \
} \
readers += (new & DCB_COUNT_MASK); \
} \
@@ -1008,11 +1008,11 @@
int new; \
uint32_t *rp = &nca_gv[cpu].dcb_readers; \
int old = *rp; \
\
new = old & ~DCB_COUNT_USELOCK; \
- while (cas32(rp, old, new) != old) { \
+ while (atomic_cas_32(rp, old, new) != old) { \
old = *rp; \
new = old & ~DCB_COUNT_USELOCK; \
} \
} \
mutex_exit(&nca_dcb_lock); \
@@ -1541,11 +1541,11 @@
\
do { \
_p = conn_tp; \
if ((_np = _p + 1) == &con_tv[CON_TV_SZ]) \
_np = con_tv; \
- } while (casptr(&conn_tp, _p, _np) != _p); \
+ } while (atomic_cas_ptr(&conn_tp, _p, _np) != _p); \
_p->conn = (p); \
_p->action = (a); \
_p->ref = (p)->ref; \
_p->cpu = CPU->cpu_seqid; \
NCA_CONN_T_TRACE_STK(); \
@@ -1763,11 +1763,11 @@
do { \
_otp = nca_counter_tp; \
_ntp = _otp + 1; \
if (_ntp == &nca_counter_tv[NCA_COUNTER_TRACE_SZ]) \
_ntp = nca_counter_tv; \
- } while (casptr((void *)&nca_counter_tp, (void *)_otp, \
+ } while (atomic_cas_ptr((void *)&nca_counter_tp, (void *)_otp, \
(void *)_ntp) != (void *)_otp); \
_ntp->t = gethrtime(); \
_ntp->p = p; \
_ntp->v = v; \
_ntp->nv = _nv; \