Implement atomic_swap_64(9).
This commit is contained in:
parent
cb0eecdf92
commit
ac97c7e4c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337432
@ -249,6 +249,19 @@ atomic_subtract_64(volatile u_int64_t *p, u_int64_t val)
|
||||
__with_interrupts_disabled(*p -= val);
|
||||
}
|
||||
|
||||
static __inline uint64_t
|
||||
atomic_swap_64(volatile uint64_t *p, uint64_t v)
|
||||
{
|
||||
uint64_t value;
|
||||
|
||||
__with_interrupts_disabled(
|
||||
{
|
||||
value = *p;
|
||||
*p = v;
|
||||
});
|
||||
return (value);
|
||||
}
|
||||
|
||||
#else /* !_KERNEL */
|
||||
|
||||
static __inline void
|
||||
|
Loading…
Reference in New Issue
Block a user