summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.h
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1998-08-06 08:33:19 +0000
committerdfr <dfr@FreeBSD.org>1998-08-06 08:33:19 +0000
commit0864bef6791e1818c64fa41c0eb3e69ffe0066d9 (patch)
tree7d9411f07b566d86fd0730872a748080ff8a6d8b /sys/vm/vm_object.h
parent203de4af5d0b4c199f18b2451ea9b044b2c8a6b2 (diff)
downloadFreeBSD-src-0864bef6791e1818c64fa41c0eb3e69ffe0066d9.zip
FreeBSD-src-0864bef6791e1818c64fa41c0eb3e69ffe0066d9.tar.gz
Protect all modifications to paging_in_progress with splvm(). The i386
managed to avoid corruption of this variable by luck (the compiler used a memory read-modify-write instruction which wasn't interruptable) but other architectures cannot. With this change, I am now able to 'make buildworld' on the alpha (sfx: the crowd goes wild...)
Diffstat (limited to 'sys/vm/vm_object.h')
-rw-r--r--sys/vm/vm_object.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index e700d53..4855a80 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.h,v 1.48 1998/04/29 04:28:12 dyson Exp $
+ * $Id: vm_object.h,v 1.49 1998/05/04 17:12:53 dyson Exp $
*/
/*
@@ -160,10 +160,21 @@ extern vm_object_t kmem_object;
#endif /* KERNEL */
#ifdef KERNEL
+
+static __inline void
+vm_object_pip_add(vm_object_t object, int i)
+{
+ int s = splvm();
+ object->paging_in_progress += i;
+ splx(s);
+}
+
static __inline void
vm_object_pip_wakeup(vm_object_t object)
{
+ int s = splvm();
object->paging_in_progress--;
+ splx(s);
if ((object->flags & OBJ_PIPWNT) && object->paging_in_progress == 0) {
object->flags &= ~OBJ_PIPWNT;
wakeup(object);
OpenPOWER on IntegriCloud