==== //depot/yahoo/ybsd_4/src/sys/vm/vm_extern.h#4 - /homes/ps/p4/yahoo/ybsd_4/src/sys/vm/vm_extern.h ====
@@ -77,9 +77,8 @@
 int useracc __P((caddr_t, int, int));
 int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, int));
 void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t));
-void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
+void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t, boolean_t));
+int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t));
 void vm_fork __P((struct proc *, struct proc *, int));
 void vm_waitproc __P((struct proc *));
 int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, void *, vm_ooffset_t));
==== //depot/yahoo/ybsd_4/src/sys/vm/vm_fault.c#5 - /homes/ps/p4/yahoo/ybsd_4/src/sys/vm/vm_fault.c ====
@@ -888,9 +888,8 @@
  *	Wire down a range of virtual addresses in a map.
  */
 int
-vm_fault_wire(map, start, end)
-	vm_map_t map;
-	vm_offset_t start, end;
+vm_fault_wire(vm_map_t map, vm_offset_t start, vm_offset_t end,
+    boolean_t user_wire, boolean_t fictitious)
 {
 
 	register vm_offset_t va;
@@ -912,68 +911,26 @@
 	 */
 
 	for (va = start; va < end; va += PAGE_SIZE) {
-		rv = vm_fault(map, va, VM_PROT_READ|VM_PROT_WRITE,
-			VM_FAULT_CHANGE_WIRING);
+		rv = vm_fault(map, va,
+		    user_wire ? VM_PROT_READ : VM_PROT_READ | VM_PROT_WRITE,
+		    user_wire ? VM_FAULT_USER_WIRE : VM_FAULT_CHANGE_WIRING);
 		if (rv) {
 			if (va != start)
-				vm_fault_unwire(map, start, va);
-			return (rv);
-		}
-	}
-	return (KERN_SUCCESS);
-}
-
-/*
- *	vm_fault_user_wire:
- *
- *	Wire down a range of virtual addresses in a map.  This
- *	is for user mode though, so we only ask for read access
- *	on currently read only sections.
- */
-int
-vm_fault_user_wire(map, start, end)
-	vm_map_t map;
-	vm_offset_t start, end;
-{
-
-	register vm_offset_t va;
-	register pmap_t pmap;
-	int rv;
-
-	pmap = vm_map_pmap(map);
-
-	/*
-	 * Inform the physical mapping system that the range of addresses may
-	 * not fault, so that page tables and such can be locked down as well.
-	 */
-
-	pmap_pageable(pmap, start, end, FALSE);
-
-	/*
-	 * We simulate a fault to get the page and enter it in the physical
-	 * map.
-	 */
-	for (va = start; va < end; va += PAGE_SIZE) {
-		rv = vm_fault(map, va, VM_PROT_READ, VM_FAULT_USER_WIRE);
-		if (rv) {
-			if (va != start)
-				vm_fault_unwire(map, start, va);
+				vm_fault_unwire(map, start, va, fictitious);
 			return (rv);
 		}
 	}
 	return (KERN_SUCCESS);
 }
 
-
 /*
  *	vm_fault_unwire:
  *
  *	Unwire a range of virtual addresses in a map.
  */
 void
-vm_fault_unwire(map, start, end)
-	vm_map_t map;
-	vm_offset_t start, end;
+vm_fault_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end,
+    boolean_t fictitious)
 {
 
 	vm_offset_t va;
@@ -991,7 +948,8 @@
 		pa = pmap_extract(pmap, va);
 		if (pa != 0) {
 			pmap_change_wiring(pmap, va, FALSE);
-			vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1);
+			if (!fictitious)
+				vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1);
 		}
 	}
 
==== //depot/yahoo/ybsd_4/src/sys/vm/vm_map.c#24 - /homes/ps/p4/yahoo/ybsd_4/src/sys/vm/vm_map.c ====
@@ -1536,6 +1536,7 @@
 	vm_map_entry_t entry;
 	vm_map_entry_t start_entry;
 	vm_offset_t end;
+	boolean_t fictitious;
 	int rv = KERN_SUCCESS;
 
 	vm_map_lock(map);
@@ -1600,11 +1601,13 @@
 			 * manipulated to avoid deadlocks.  The in-transition
 			 * flag protects the entries. 
 			 */
+			fictitious = entry->object.vm_object != NULL &&
+			    entry->object.vm_object->type == OBJT_DEVICE;
 			save_start = entry->start;
 			save_end = entry->end;
 			vm_map_unlock(map);
 			map->timestamp++;
-			rv = vm_fault_user_wire(map, save_start, save_end);
+			rv = vm_fault_wire(map, save_start, save_end, 1, fictitious);
 			vm_map_lock(map);
 			if (rv) {
 				CLIP_CHECK_BACK(entry, save_start);
@@ -1675,7 +1678,9 @@
 			entry->eflags &= ~MAP_ENTRY_USER_WIRED;
 			entry->wired_count--;
 			if (entry->wired_count == 0)
-				vm_fault_unwire(map, entry->start, entry->end);
+				vm_fault_unwire(map, entry->start, entry->end,
+				    entry->object.vm_object != NULL &&
+				    entry->object.vm_object->type == OBJT_DEVICE);
 			entry = entry->next;
 		}
 	}
@@ -1708,6 +1713,7 @@
 	vm_map_entry_t entry;
 	vm_map_entry_t start_entry;
 	vm_offset_t end;
+	boolean_t fictitious;
 	int rv = KERN_SUCCESS;
 	int s;
 
@@ -1821,8 +1827,10 @@
 			vm_offset_t save_start = entry->start;
 			vm_offset_t save_end = entry->end;
 
+			fictitious = entry->object.vm_object != NULL &&
+			    entry->object.vm_object->type == OBJT_DEVICE;
 			if (entry->wired_count == 1)
-				rv = vm_fault_wire(map, entry->start, entry->end);
+				rv = vm_fault_wire(map, entry->start, entry->end, 0, fictitious);
 			if (rv) {
 				CLIP_CHECK_BACK(entry, save_start);
 				for (;;) {
@@ -1888,7 +1896,9 @@
 		while ((entry != &map->header) && (entry->start < end)) {
 			entry->wired_count--;
 			if (entry->wired_count == 0)
-				vm_fault_unwire(map, entry->start, entry->end);
+				vm_fault_unwire(map, entry->start, entry->end,
+				    entry->object.vm_object != NULL &&
+				    entry->object.vm_object->type == OBJT_DEVICE);
 			entry = entry->next;
 		}
 	}
@@ -2044,7 +2054,9 @@
 	vm_map_t map;
 	vm_map_entry_t entry;
 {
-	vm_fault_unwire(map, entry->start, entry->end);
+	vm_fault_unwire(map, entry->start, entry->end,
+	    entry->object.vm_object != NULL &&
+	    entry->object.vm_object->type == OBJT_DEVICE);
 	entry->wired_count = 0;
 }
 
==== //depot/yahoo/ybsd_4/src/sys/vm/vm_page.c#8 - /homes/ps/p4/yahoo/ybsd_4/src/sys/vm/vm_page.c ====
@@ -1230,6 +1230,8 @@
 	 * and only unqueue the page if it is on some queue (if it is unmanaged
 	 * it is already off the queues).
 	 */
+	if (m->flags & PG_FICTITIOUS)
+		return;
 	s = splvm();
 	if (m->wire_count == 0) {
 		if ((m->flags & PG_UNMANAGED) == 0)
@@ -1277,6 +1279,8 @@
 {
 	int s;
 
+	if (m->flags & PG_FICTITIOUS)
+		return;
 	s = splvm();
 
 	if (m->wire_count > 0) {
