diff options
author | alc <alc@FreeBSD.org> | 2012-08-03 01:48:15 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2012-08-03 01:48:15 +0000 |
commit | 5b4712b5a1c865efad377e8493e31ac125d837c7 (patch) | |
tree | feac91ca3709b2a50de97b74a3f44576f91012df /sys/vm/vm_page.c | |
parent | 6f0d7f5c9334687c2452ded29416115eb0dc218d (diff) | |
download | FreeBSD-src-5b4712b5a1c865efad377e8493e31ac125d837c7.zip FreeBSD-src-5b4712b5a1c865efad377e8493e31ac125d837c7.tar.gz |
Inline vm_page_aflags_clear() and vm_page_aflags_set().
Add comments stating that neither these functions nor the flags that they
are used to manipulate are part of the KBI.
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 8e76727..53353e9 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -450,63 +450,6 @@ vm_page_startup(vm_offset_t vaddr) return (vaddr); } - -CTASSERT(offsetof(struct vm_page, aflags) % sizeof(uint32_t) == 0); - -void -vm_page_aflag_set(vm_page_t m, uint8_t bits) -{ - uint32_t *addr, val; - - /* - * The PGA_WRITEABLE flag can only be set if the page is managed and - * VPO_BUSY. Currently, this flag is only set by pmap_enter(). - */ - KASSERT((bits & PGA_WRITEABLE) == 0 || - (m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == VPO_BUSY, - ("PGA_WRITEABLE and !VPO_BUSY")); - - /* - * We want to use atomic updates for m->aflags, which is a - * byte wide. Not all architectures provide atomic operations - * on the single-byte destination. Punt and access the whole - * 4-byte word with an atomic update. Parallel non-atomic - * updates to the fields included in the update by proximity - * are handled properly by atomics. - */ - addr = (void *)&m->aflags; - MPASS(((uintptr_t)addr & (sizeof(uint32_t) - 1)) == 0); - val = bits; -#if BYTE_ORDER == BIG_ENDIAN - val <<= 24; -#endif - atomic_set_32(addr, val); -} - -void -vm_page_aflag_clear(vm_page_t m, uint8_t bits) -{ - uint32_t *addr, val; - - /* - * The PGA_REFERENCED flag can only be cleared if the object - * containing the page is locked. - */ - KASSERT((bits & PGA_REFERENCED) == 0 || VM_OBJECT_LOCKED(m->object), - ("PGA_REFERENCED and !VM_OBJECT_LOCKED")); - - /* - * See the comment in vm_page_aflag_set(). - */ - addr = (void *)&m->aflags; - MPASS(((uintptr_t)addr & (sizeof(uint32_t) - 1)) == 0); - val = bits; -#if BYTE_ORDER == BIG_ENDIAN - val <<= 24; -#endif - atomic_clear_32(addr, val); -} - void vm_page_reference(vm_page_t m) { |