mirror of
https://github.com/opnsense/src.git
synced 2026-07-02 22:09:51 -04:00
sparc64: add atomic_fcmpset
Tested on hardware provided by feld. Reviewed by: marius
This commit is contained in:
parent
36289c3336
commit
4cf80fbd79
1 changed files with 34 additions and 0 deletions
|
|
@ -219,6 +219,40 @@ atomic_cmpset_rel_ ## name(volatile ptype p, vtype e, vtype s) \
|
|||
return (((vtype)atomic_cas_rel((p), (e), (s), sz)) == (e)); \
|
||||
} \
|
||||
\
|
||||
static __inline int \
|
||||
atomic_fcmpset_ ## name(volatile ptype p, vtype *ep, vtype s) \
|
||||
{ \
|
||||
vtype t; \
|
||||
\
|
||||
t = (vtype)atomic_cas((p), (*ep), (s), sz); \
|
||||
if (t == (*ep)) \
|
||||
return (1); \
|
||||
*ep = t; \
|
||||
return (0); \
|
||||
} \
|
||||
static __inline int \
|
||||
atomic_fcmpset_acq_ ## name(volatile ptype p, vtype *ep, vtype s) \
|
||||
{ \
|
||||
vtype t; \
|
||||
\
|
||||
t = (vtype)atomic_cas_acq((p), (*ep), (s), sz); \
|
||||
if (t == (*ep)) \
|
||||
return (1); \
|
||||
*ep = t; \
|
||||
return (0); \
|
||||
} \
|
||||
static __inline int \
|
||||
atomic_fcmpset_rel_ ## name(volatile ptype p, vtype *ep, vtype s) \
|
||||
{ \
|
||||
vtype t; \
|
||||
\
|
||||
t = (vtype)atomic_cas_rel((p), (*ep), (s), sz); \
|
||||
if (t == (*ep)) \
|
||||
return (1); \
|
||||
*ep = t; \
|
||||
return (0); \
|
||||
} \
|
||||
\
|
||||
static __inline vtype \
|
||||
atomic_load_ ## name(volatile ptype p) \
|
||||
{ \
|
||||
|
|
|
|||
Loading…
Reference in a new issue