Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Introduce uvm_km_valloc_align() and use it to glab proce...



details:   https://anonhg.NetBSD.org/src/rev/370415db3963
branches:  trunk
changeset: 499689:370415db3963
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Mon Nov 27 04:36:40 2000 +0000

description:
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.

diffstat:

 sys/kern/kern_fork.c |   4 ++--
 sys/uvm/uvm_extern.h |   3 ++-
 sys/uvm/uvm_km.c     |  13 +++++++++++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r 42f68dc81cc3 -r 370415db3963 sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c      Mon Nov 27 03:33:57 2000 +0000
+++ b/sys/kern/kern_fork.c      Mon Nov 27 04:36:40 2000 +0000
@@ -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 @@
         * 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--;
diff -r 42f68dc81cc3 -r 370415db3963 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Mon Nov 27 03:33:57 2000 +0000
+++ b/sys/uvm/uvm_extern.h      Mon Nov 27 04:36:40 2000 +0000
@@ -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 @@
                                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));
diff -r 42f68dc81cc3 -r 370415db3963 sys/uvm/uvm_km.c
--- a/sys/uvm/uvm_km.c  Mon Nov 27 03:33:57 2000 +0000
+++ b/sys/uvm/uvm_km.c  Mon Nov 27 04:36:40 2000 +0000
@@ -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.
@@ -732,6 +732,15 @@
        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 @@
         */
 
        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);



Home | Main Index | Thread Index | Old Index