Add a new `access type' argument to pmap_enter(). This indicates what type of
memory access a mapping was caused by. This is passed through from uvm_fault() and udv_fault(), and in most other cases is 0. The pmap module may use this to preset R/M information. On MMUs which require R/M emulation, the implementation may preset the bits and avoid taking another fault. On MMUs which keep R/M information in hardware, the implementation may preset its cached bits to speed up the next call to pmap_is_modified() or pmap_is_referenced().
This commit is contained in:
parent
669f51ad27
commit
31a2536cd0
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uvm_device.c,v 1.14 1999/03/25 18:48:50 mrg Exp $ */
|
||||
/* $NetBSD: uvm_device.c,v 1.15 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -476,7 +476,8 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags)
|
|||
UVMHIST_LOG(maphist,
|
||||
" MAPPING: device: pm=0x%x, va=0x%x, pa=0x%x, at=%d",
|
||||
ufi->orig_map->pmap, curr_va, (int)paddr, access_type);
|
||||
pmap_enter(ufi->orig_map->pmap, curr_va, paddr, access_type, 0);
|
||||
pmap_enter(ufi->orig_map->pmap, curr_va, paddr, access_type, 0,
|
||||
access_type);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uvm_fault.c,v 1.22 1999/03/26 17:34:16 chs Exp $ */
|
||||
/* $NetBSD: uvm_fault.c,v 1.23 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -648,7 +648,7 @@ ReFault:
|
|||
* ensure that we pmap_enter page R/O since
|
||||
* needs_copy is still true
|
||||
*/
|
||||
enter_prot = enter_prot & ~VM_PROT_WRITE;
|
||||
enter_prot &= ~VM_PROT_WRITE;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ ReFault:
|
|||
pmap_enter(ufi.orig_map->pmap, currva,
|
||||
VM_PAGE_TO_PHYS(anon->u.an_page),
|
||||
(anon->an_ref > 1) ? VM_PROT_READ : enter_prot,
|
||||
(ufi.entry->wired_count != 0));
|
||||
(ufi.entry->wired_count != 0), 0);
|
||||
}
|
||||
simple_unlock(&anon->an_lock);
|
||||
}
|
||||
|
@ -947,7 +947,8 @@ ReFault:
|
|||
pmap_enter(ufi.orig_map->pmap, currva,
|
||||
VM_PAGE_TO_PHYS(pages[lcv]),
|
||||
UVM_ET_ISCOPYONWRITE(ufi.entry) ?
|
||||
VM_PROT_READ : enter_prot, wired);
|
||||
VM_PROT_READ : enter_prot, wired,
|
||||
access_type);
|
||||
|
||||
/*
|
||||
* NOTE: page can't be PG_WANTED or PG_RELEASED
|
||||
|
@ -1202,7 +1203,7 @@ ReFault:
|
|||
UVMHIST_LOG(maphist, " MAPPING: anon: pm=0x%x, va=0x%x, pg=0x%x",
|
||||
ufi.orig_map->pmap, ufi.orig_rvaddr, pg, 0);
|
||||
pmap_enter(ufi.orig_map->pmap, ufi.orig_rvaddr, VM_PAGE_TO_PHYS(pg),
|
||||
enter_prot, wired);
|
||||
enter_prot, wired, access_type);
|
||||
|
||||
/*
|
||||
* ... and update the page queues.
|
||||
|
@ -1630,7 +1631,7 @@ Case2:
|
|||
" MAPPING: case2: pm=0x%x, va=0x%x, pg=0x%x, promote=%d",
|
||||
ufi.orig_map->pmap, ufi.orig_rvaddr, pg, promote);
|
||||
pmap_enter(ufi.orig_map->pmap, ufi.orig_rvaddr, VM_PAGE_TO_PHYS(pg),
|
||||
enter_prot, wired);
|
||||
enter_prot, wired, access_type);
|
||||
|
||||
uvm_lock_pageq();
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uvm_glue.c,v 1.17 1999/03/25 18:48:51 mrg Exp $ */
|
||||
/* $NetBSD: uvm_glue.c,v 1.18 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
|
@ -211,7 +211,7 @@ uvm_chgkprot(addr, len, rw)
|
|||
pa = pmap_extract(pmap_kernel(), sva|1);
|
||||
if (pa == 0)
|
||||
panic("chgkprot: invalid page");
|
||||
pmap_enter(pmap_kernel(), sva, pa&~1, prot, TRUE);
|
||||
pmap_enter(pmap_kernel(), sva, pa&~1, prot, TRUE, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uvm_km.c,v 1.21 1999/03/26 17:34:16 chs Exp $ */
|
||||
/* $NetBSD: uvm_km.c,v 1.22 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
|
@ -732,7 +732,7 @@ uvm_km_kmemalloc(map, obj, size, flags)
|
|||
pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg), VM_PROT_ALL);
|
||||
#else
|
||||
pmap_enter(map->pmap, loopva, VM_PAGE_TO_PHYS(pg),
|
||||
UVM_PROT_ALL, TRUE);
|
||||
UVM_PROT_ALL, TRUE, 0);
|
||||
#endif
|
||||
loopva += PAGE_SIZE;
|
||||
offset += PAGE_SIZE;
|
||||
|
@ -865,7 +865,7 @@ uvm_km_alloc1(map, size, zeroit)
|
|||
pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg), UVM_PROT_ALL);
|
||||
#else
|
||||
pmap_enter(map->pmap, loopva, VM_PAGE_TO_PHYS(pg),
|
||||
UVM_PROT_ALL, TRUE);
|
||||
UVM_PROT_ALL, TRUE, 0);
|
||||
#endif
|
||||
loopva += PAGE_SIZE;
|
||||
offset += PAGE_SIZE;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uvm_page.c,v 1.16 1999/03/25 18:48:53 mrg Exp $ */
|
||||
/* $NetBSD: uvm_page.c,v 1.17 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
|
@ -426,7 +426,8 @@ uvm_pageboot_alloc(size)
|
|||
pmap_kenter_pa(vaddr, paddr, VM_PROT_READ|VM_PROT_WRITE);
|
||||
#else
|
||||
pmap_enter(pmap_kernel(), vaddr, paddr,
|
||||
VM_PROT_READ|VM_PROT_WRITE, FALSE);
|
||||
VM_PROT_READ|VM_PROT_WRITE, FALSE,
|
||||
VM_PROT_READ|VM_PROT_WRITE);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uvm_pager.c,v 1.15 1999/03/25 18:48:55 mrg Exp $ */
|
||||
/* $NetBSD: uvm_pager.c,v 1.16 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -185,7 +185,7 @@ ReStart:
|
|||
#endif
|
||||
|
||||
pmap_enter(vm_map_pmap(pager_map), cva, VM_PAGE_TO_PHYS(pp),
|
||||
VM_PROT_DEFAULT, TRUE);
|
||||
VM_PROT_DEFAULT, TRUE, 0);
|
||||
}
|
||||
|
||||
#endif /* PMAP_NEW */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.h,v 1.28 1999/01/16 20:00:28 chuck Exp $ */
|
||||
/* $NetBSD: pmap.h,v 1.29 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
|
@ -143,7 +143,7 @@ pmap_t pmap_create __P((vsize_t));
|
|||
#endif
|
||||
void pmap_destroy __P((pmap_t));
|
||||
void pmap_enter __P((pmap_t,
|
||||
vaddr_t, paddr_t, vm_prot_t, boolean_t));
|
||||
vaddr_t, paddr_t, vm_prot_t, boolean_t, vm_prot_t));
|
||||
paddr_t pmap_extract __P((pmap_t, vaddr_t));
|
||||
#if defined(PMAP_NEW) && defined(PMAP_GROWKERNEL)
|
||||
void pmap_growkernel __P((vaddr_t));
|
||||
|
|
Loading…
Reference in New Issue