Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pmax/pmax In cpu_startup():



details:   https://anonhg.NetBSD.org/src/rev/da5823983086
branches:  trunk
changeset: 472102:da5823983086
user:      simonb <simonb%NetBSD.org@localhost>
date:      Wed Apr 21 02:03:24 1999 +0000

description:
In cpu_startup():
 + Initialise minaddr to the start of the file I/O buffers.
 + Check for overallocation of RAM for these buffers.
 + Change function name in panic message to match reality.

Code taken from almost every other port, and fixes the:
   uvm_km_suballoc: unable to allocate space in parent map
panic that some people have been experiencing.

diffstat:

 sys/arch/pmax/pmax/machdep.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 0936f66f39f1 -r da5823983086 sys/arch/pmax/pmax/machdep.c
--- a/sys/arch/pmax/pmax/machdep.c      Wed Apr 21 00:20:20 1999 +0000
+++ b/sys/arch/pmax/pmax/machdep.c      Wed Apr 21 02:03:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.135 1999/04/11 04:04:09 chs Exp $        */
+/*     $NetBSD: machdep.c,v 1.136 1999/04/21 02:03:24 simonb Exp $     */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.135 1999/04/11 04:04:09 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.136 1999/04/21 02:03:24 simonb Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -548,9 +548,16 @@
                    NULL, UVM_UNKNOWN_OFFSET,
                    UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
                                UVM_ADV_NORMAL, 0)) != KERN_SUCCESS)
-               panic("startup: cannot allocate VM for buffers");
+               panic("cpu_startup: cannot allocate VM for buffers");
+
+       minaddr = (vaddr_t)buffers;
+       if ((bufpages / nbuf) >= btoc(MAXBSIZE)) {
+               bufpages = btoc(MAXBSIZE) * nbuf; /* do not overallocate RAM */
+       }
        base = bufpages / nbuf;
        residual = bufpages % nbuf;
+
+       /* now allocate RAM for buffers */
        for (i = 0; i < nbuf; i++) {
                vsize_t curbufsize;
                vaddr_t curbuf;



Home | Main Index | Thread Index | Old Index