Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/mpc6xx When allocate VA for the msgbuf, don...



details:   https://anonhg.NetBSD.org/src/rev/205bc6dfd600
branches:  trunk
changeset: 533797:205bc6dfd600
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Jul 09 19:05:00 2002 +0000

description:
When allocate VA for the msgbuf, don't allocate pages too since we have
already done that in pmap_bootstrap.  (fixes a small page leak at startup).

diffstat:

 sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r e7b2787d20ff -r 205bc6dfd600 sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c
--- a/sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c  Tue Jul 09 17:41:27 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c  Tue Jul 09 19:05:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpc6xx_machdep.c,v 1.2 2002/07/05 18:45:22 matt Exp $  */
+/*     $NetBSD: mpc6xx_machdep.c,v 1.3 2002/07/09 19:05:00 matt Exp $  */
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -424,10 +424,16 @@
         sz = round_page(MSGBUFSIZE);
        v = (caddr_t) msgbuf_paddr;
        if (msgbuf_paddr + sz > SEGMENT_LENGTH) {
-               v = (caddr_t)uvm_km_zalloc(kernel_map, sz);
+               minaddr = 0;
+               if (uvm_map(kernel_map, &minaddr, sz,
+                               NULL, UVM_UNKNOWN_OFFSET, 0,
+                               UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE,
+                                   UVM_INH_NONE, UVM_ADV_NORMAL, 0)) != 0)
+                       panic("startup: cannot allocate VM for msgbuf");
+               v = (caddr_t)minaddr;
                for (i = 0; i < sz; i += NBPG) {
-                       pmap_kenter_pa((vaddr_t) v + i, msgbuf_paddr + i,
-                               VM_PROT_READ|VM_PROT_WRITE);
+                       pmap_kenter_pa(minaddr + i, msgbuf_paddr + i,
+                           VM_PROT_READ|VM_PROT_WRITE);
                }
                pmap_update(pmap_kernel());
        }



Home | Main Index | Thread Index | Old Index