Deleted Added
full compact
vm_fault.c (21673) vm_fault.c (21754)
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1994 John S. Dyson
5 * All rights reserved.
6 * Copyright (c) 1994 David Greenman
7 * All rights reserved.
8 *

--- 52 unchanged lines hidden (view full) ---

61 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
62 * School of Computer Science
63 * Carnegie Mellon University
64 * Pittsburgh PA 15213-3890
65 *
66 * any improvements or extensions that they make and grant Carnegie the
67 * rights to redistribute these changes.
68 *
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1994 John S. Dyson
5 * All rights reserved.
6 * Copyright (c) 1994 David Greenman
7 * All rights reserved.
8 *

--- 52 unchanged lines hidden (view full) ---

61 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
62 * School of Computer Science
63 * Carnegie Mellon University
64 * Pittsburgh PA 15213-3890
65 *
66 * any improvements or extensions that they make and grant Carnegie the
67 * rights to redistribute these changes.
68 *
69 * $FreeBSD: head/sys/vm/vm_fault.c 21673 1997-01-14 07:20:47Z jkh $
69 * $FreeBSD: head/sys/vm/vm_fault.c 21754 1997-01-16 04:16:22Z dyson $
70 */
71
72/*
73 * Page fault handling module.
74 */
75
76#include <sys/param.h>
77#include <sys/systm.h>

--- 114 unchanged lines hidden (view full) ---

192 */
193
194 if ((result = vm_map_lookup(&map, vaddr,
195 fault_type, &entry, &first_object,
196 &first_pindex, &prot, &wired, &su)) != KERN_SUCCESS) {
197 return (result);
198 }
199
70 */
71
72/*
73 * Page fault handling module.
74 */
75
76#include <sys/param.h>
77#include <sys/systm.h>

--- 114 unchanged lines hidden (view full) ---

192 */
193
194 if ((result = vm_map_lookup(&map, vaddr,
195 fault_type, &entry, &first_object,
196 &first_pindex, &prot, &wired, &su)) != KERN_SUCCESS) {
197 return (result);
198 }
199
200 if (entry->nofault) {
200 if (entry->eflags & MAP_ENTRY_NOFAULT) {
201 panic("vm_fault: fault on nofault entry, addr: %lx",
202 vaddr);
203 }
204
205 /*
206 * If we are user-wiring a r/w segment, and it is COW, then
207 * we need to do the COW operation. Note that we don't COW
208 * currently RO sections now, because it is NOT desirable
209 * to COW .text. We simply keep .text from ever being COW'ed
210 * and take the heat that one cannot debug wired .text sections.
211 */
201 panic("vm_fault: fault on nofault entry, addr: %lx",
202 vaddr);
203 }
204
205 /*
206 * If we are user-wiring a r/w segment, and it is COW, then
207 * we need to do the COW operation. Note that we don't COW
208 * currently RO sections now, because it is NOT desirable
209 * to COW .text. We simply keep .text from ever being COW'ed
210 * and take the heat that one cannot debug wired .text sections.
211 */
212 if ((change_wiring == VM_FAULT_USER_WIRE) && entry->needs_copy) {
212 if ((change_wiring == VM_FAULT_USER_WIRE) && (entry->eflags & MAP_ENTRY_NEEDS_COPY)) {
213 if(entry->protection & VM_PROT_WRITE) {
214 int tresult;
215 vm_map_lookup_done(map, entry);
216
217 tresult = vm_map_lookup(&map, vaddr, VM_PROT_READ|VM_PROT_WRITE,
218 &entry, &first_object, &first_pindex, &prot, &wired, &su);
219 if (tresult != KERN_SUCCESS)
220 return tresult;

--- 992 unchanged lines hidden ---
213 if(entry->protection & VM_PROT_WRITE) {
214 int tresult;
215 vm_map_lookup_done(map, entry);
216
217 tresult = vm_map_lookup(&map, vaddr, VM_PROT_READ|VM_PROT_WRITE,
218 &entry, &first_object, &first_pindex, &prot, &wired, &su);
219 if (tresult != KERN_SUCCESS)
220 return tresult;

--- 992 unchanged lines hidden ---