Introduce uvm_km_valloc_align() and use it to glab process's USPACE

aligned on USPACE boundary in kernel virutal address.  It's benefitial
for MIPS R4000's paired TLB entry design.
This commit is contained in:
nisimura 2000-11-27 04:36:40 +00:00
parent 0055236dda
commit 10571faa84
3 changed files with 15 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_fork.c,v 1.76 2000/11/08 05:16:23 chs Exp $ */
/* $NetBSD: kern_fork.c,v 1.77 2000/11/27 04:36:41 nisimura Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -145,7 +145,7 @@ fork1(struct proc *p1, int flags, int exitsig, void *stack, size_t stacksize,
* kernel virtual address space. The actual U-area pages will
* be allocated and wired in vm_fork().
*/
uaddr = uvm_km_valloc(kernel_map, USPACE);
uaddr = uvm_km_valloc_align(kernel_map, USPACE, USPACE);
if (__predict_false(uaddr == 0)) {
(void)chgproccnt(uid, -1);
nprocs--;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_extern.h,v 1.51 2000/09/28 19:05:06 eeh Exp $ */
/* $NetBSD: uvm_extern.h,v 1.52 2000/11/27 04:36:40 nisimura Exp $ */
/*
*
@ -454,6 +454,7 @@ struct vm_map *uvm_km_suballoc __P((vm_map_t, vaddr_t *,
vaddr_t *, vsize_t, int,
boolean_t, vm_map_t));
vaddr_t uvm_km_valloc __P((vm_map_t, vsize_t));
vaddr_t uvm_km_valloc_align __P((vm_map_t, vsize_t, vsize_t));
vaddr_t uvm_km_valloc_wait __P((vm_map_t, vsize_t));
vaddr_t uvm_km_valloc_prefer_wait __P((vm_map_t, vsize_t,
voff_t));

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_km.c,v 1.40 2000/11/24 07:07:27 chs Exp $ */
/* $NetBSD: uvm_km.c,v 1.41 2000/11/27 04:36:40 nisimura Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -731,6 +731,15 @@ vaddr_t
uvm_km_valloc(map, size)
vm_map_t map;
vsize_t size;
{
return(uvm_km_valloc_align(map, size, 0));
}
vaddr_t
uvm_km_valloc_align(map, size, align)
vm_map_t map;
vsize_t size;
vsize_t align;
{
vaddr_t kva;
UVMHIST_FUNC("uvm_km_valloc"); UVMHIST_CALLED(maphist);
@ -746,7 +755,7 @@ uvm_km_valloc(map, size)
*/
if (__predict_false(uvm_map(map, &kva, size, uvm.kernel_object,
UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL,
UVM_UNKNOWN_OFFSET, align, UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL,
UVM_INH_NONE, UVM_ADV_RANDOM,
0)) != KERN_SUCCESS)) {
UVMHIST_LOG(maphist, "<- done (no VM)", 0,0,0,0);