Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.h
Show First 20 Lines • Show All 866 Lines • ▼ Show 20 Lines | vm_page_aflag_set(vm_page_t m, uint16_t bits) | ||||
* within this word are handled properly by the atomic update. | * within this word are handled properly by the atomic update. | ||||
*/ | */ | ||||
addr = (void *)&m->a; | addr = (void *)&m->a; | ||||
val = bits << VM_PAGE_AFLAG_SHIFT; | val = bits << VM_PAGE_AFLAG_SHIFT; | ||||
atomic_set_32(addr, val); | atomic_set_32(addr, val); | ||||
} | } | ||||
/* | /* | ||||
* Conditionally set the given bits in the specified page. | |||||
* | |||||
* Like vm_page_aflag_set, but avoid the operation if the bits | |||||
* to set are already there. | |||||
*/ | |||||
static inline void | |||||
vm_page_aflag_set_cond(vm_page_t m, uint16_t bits) | |||||
{ | |||||
uint32_t *addr, val; | |||||
VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits); | |||||
addr = (void *)&m->a; | |||||
val = bits << VM_PAGE_AFLAG_SHIFT; | |||||
if ((atomic_load_32(addr) & val) != val) | |||||
atomic_set_32(addr, val); | |||||
} | |||||
/* | |||||
* vm_page_dirty: | * vm_page_dirty: | ||||
* | * | ||||
* Set all bits in the page's dirty field. | * Set all bits in the page's dirty field. | ||||
* | * | ||||
* The object containing the specified page must be locked if the | * The object containing the specified page must be locked if the | ||||
* call is made from the machine-independent layer. | * call is made from the machine-independent layer. | ||||
* | * | ||||
* See vm_page_clear_dirty_mask(). | * See vm_page_clear_dirty_mask(). | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |