Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_fault.c
Context not available. | |||||
bool dead, hardfault, is_first_object_locked; | bool dead, hardfault, is_first_object_locked; | ||||
VM_CNT_INC(v_vm_faults); | VM_CNT_INC(v_vm_faults); | ||||
fs.vp = NULL; | fs.vp = NULL; | ||||
faultcount = 0; | faultcount = 0; | ||||
nera = -1; | nera = -1; | ||||
hardfault = false; | hardfault = false; | ||||
RetryFault:; | RetryFault:; | ||||
/* | /* | ||||
* Find the backing store object and offset into it to begin the | * Find the backing store object and offset into it to begin the | ||||
* search. | * search. | ||||
*/ | */ | ||||
fs.map = map; | fs.map = map; | ||||
result = vm_map_lookup(&fs.map, vaddr, fault_type | | result = (vaddr < vm_map_min(map) || vaddr >= vm_map_max(map)) ? | ||||
VM_PROT_FAULT_LOOKUP, &fs.entry, &fs.first_object, | KERN_INVALID_ADDRESS : | ||||
&fs.first_pindex, &prot, &wired); | vm_map_lookup(&fs.map, vaddr, fault_type | | ||||
VM_PROT_FAULT_LOOKUP, &fs.entry, &fs.first_object, | |||||
&fs.first_pindex, &prot, &wired); | |||||
if (result != KERN_SUCCESS) { | if (result != KERN_SUCCESS) { | ||||
unlock_vp(&fs); | unlock_vp(&fs); | ||||
return (result); | return (result); | ||||
} | } | ||||
fs.map_generation = fs.map->timestamp; | fs.map_generation = fs.map->timestamp; | ||||
if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { | if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { | ||||
panic("%s: fault on nofault entry, addr: %#lx", | panic("%s: fault on nofault entry, addr: %#lx", | ||||
__func__, (u_long)vaddr); | __func__, (u_long)vaddr); | ||||
} | } | ||||
if (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION && | if (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION && | ||||
fs.entry->wiring_thread != curthread) { | fs.entry->wiring_thread != curthread) { | ||||
vm_map_unlock_read(fs.map); | vm_map_unlock_read(fs.map); | ||||
Context not available. |