summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.h
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-01-24 01:05:15 +0000
committerdillon <dillon@FreeBSD.org>1999-01-24 01:05:15 +0000
commit84015ba9cbf32a56da8e0a35a1f0879597f4a674 (patch)
treeff04f73b1e7c8ebdb5a61e758e14e0cfee9b146c /sys/vm/vm_page.h
parente854781bc880ceb518d5bb36da847ccb5467297a (diff)
downloadFreeBSD-src-84015ba9cbf32a56da8e0a35a1f0879597f4a674.zip
FreeBSD-src-84015ba9cbf32a56da8e0a35a1f0879597f4a674.tar.gz
Add invariants to vm_page_busy() and vm_page_wakeup() to check for
PG_BUSY stupidity.
Diffstat (limited to 'sys/vm/vm_page.h')
-rw-r--r--sys/vm/vm_page.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 685c53b..c74af82 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_page.h,v 1.50 1999/01/21 08:29:12 dillon Exp $
+ * $Id: vm_page.h,v 1.51 1999/01/21 10:06:24 dillon Exp $
*/
/*
@@ -312,6 +312,7 @@ vm_page_assert_wait(vm_page_t m, int interruptible)
static __inline void
vm_page_busy(vm_page_t m)
{
+ KASSERT((m->flags & PG_BUSY) == 0, ("vm_page_busy: page already busy!!!"));
vm_page_flag_set(m, PG_BUSY);
}
@@ -341,6 +342,7 @@ vm_page_flash(vm_page_t m)
static __inline void
vm_page_wakeup(vm_page_t m)
{
+ KASSERT(m->flags & PG_BUSY, ("vm_page_wakeup: page not busy!!!"));
vm_page_flag_clear(m, PG_BUSY);
vm_page_flash(m);
}
@@ -426,6 +428,15 @@ vm_page_unhold(vm_page_t mem)
KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!"));
}
+/*
+ * vm_page_protect:
+ *
+ * Reduce the protection of a page. This routine never
+ * raises the protection and therefore can be safely
+ * called if the page is already at VM_PROT_NONE ( it
+ * will be a NOP effectively ).
+ */
+
static __inline void
vm_page_protect(vm_page_t mem, int prot)
{
OpenPOWER on IntegriCloud