Description

These functions enable a compare and swap operation to occur atomically. The
value stored in target is compared with cmp. If these values are
equal, the value stored in target is replaced with newval. The old value
stored in target is returned by the function whether or not the
replacement occurred.

Return Values

These functions return the old of *target.

Errors

No errors are defined.

Context

These functions can be called from user, interrupt, or kernel context.