MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_page_astate_fcmpset

Function vm_page_astate_fcmpset

freebsd/vm/vm_page.h:818–830  ·  view source on GitHub ↗

* Atomically compare and set a page's atomic state. */

Source from the content-addressed store, hash-verified

816 * Atomically compare and set a page's atomic state.
817 */
818static inline bool
819vm_page_astate_fcmpset(vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new)
820{
821
822 KASSERT(new.queue == PQ_INACTIVE || (new.flags & PGA_REQUEUE_HEAD) == 0,
823 ("%s: invalid head requeue request for page %p", __func__, m));
824 KASSERT((new.flags & PGA_ENQUEUED) == 0 || new.queue != PQ_NONE,
825 ("%s: setting PGA_ENQUEUED with PQ_NONE in page %p", __func__, m));
826 KASSERT(new._bits != old->_bits,
827 ("%s: bits are unchanged", __func__));
828
829 return (atomic_fcmpset_32(&m->a._bits, &old->_bits, new._bits) != 0);
830}
831
832/*
833 * Clear the given bits in the specified page.

Callers 1

vm_page_pqstate_fcmpsetFunction · 0.85

Calls 1

atomic_fcmpset_32Function · 0.50

Tested by

no test coverage detected