Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_page.h
Show First 20 Lines • Show All 802 Lines • ▼ Show 20 Lines | |||||
* Clear the given bits in the specified page. | * Clear the given bits in the specified page. | ||||
*/ | */ | ||||
static inline void | static inline void | ||||
vm_page_aflag_clear(vm_page_t m, uint16_t bits) | vm_page_aflag_clear(vm_page_t m, uint16_t bits) | ||||
{ | { | ||||
uint32_t *addr, val; | uint32_t *addr, val; | ||||
/* | /* | ||||
* The PGA_REFERENCED flag can only be cleared if the page is locked. | |||||
*/ | |||||
if ((bits & PGA_REFERENCED) != 0) | |||||
vm_page_assert_locked(m); | |||||
/* | |||||
* Access the whole 32-bit word containing the aflags field with an | * Access the whole 32-bit word containing the aflags field with an | ||||
* atomic update. Parallel non-atomic updates to the other fields | * atomic update. Parallel non-atomic updates to the other fields | ||||
* 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_clear_32(addr, val); | atomic_clear_32(addr, val); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* vm_page_queue: | * vm_page_queue: | ||||
* | * | ||||
* Return the index of the queue containing m. | * Return the index of the queue containing m. | ||||
*/ | */ | ||||
static inline uint8_t | static inline uint8_t | ||||
vm_page_queue(vm_page_t m) | vm_page_queue(vm_page_t m) | ||||
{ | { | ||||
vm_page_assert_locked(m); | |||||
return (_vm_page_queue(vm_page_astate_load(m))); | return (_vm_page_queue(vm_page_astate_load(m))); | ||||
} | } | ||||
static inline bool | static inline bool | ||||
vm_page_active(vm_page_t m) | vm_page_active(vm_page_t m) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |