Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc Provide an mdallocsys() that clips bufp...



details:   https://anonhg.NetBSD.org/src/rev/af7e487d0dce
branches:  trunk
changeset: 473124:af7e487d0dce
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri May 21 00:08:14 1999 +0000

description:
Provide an mdallocsys() that clips bufpages if necessary (on the Sun4c).
This will be (and needs to be) done before nbuf is computed.

diffstat:

 sys/arch/sparc/sparc/machdep.c |  23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r 81f8f1a5a3f3 -r af7e487d0dce sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c    Fri May 21 00:05:12 1999 +0000
+++ b/sys/arch/sparc/sparc/machdep.c    Fri May 21 00:08:14 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.148 1999/05/20 20:15:27 thorpej Exp $ */
+/*     $NetBSD: machdep.c,v 1.149 1999/05/21 00:08:14 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -156,6 +156,8 @@
 void   dumpsys __P((void));
 void   stackdump __P((void));
 
+caddr_t        mdallocsys __P((caddr_t));
+
 /*
  * Machine-dependent startup code
  */
@@ -203,17 +205,14 @@
         * Find out how much space we need, allocate it,
         * and then give everything true virtual addresses.
         */
-       size = (vsize_t)allocsys(NULL, NULL);
+       size = (vsize_t)allocsys(NULL, mdallocsys);
 
        if ((v = (caddr_t)uvm_km_alloc(kernel_map, round_page(size))) == 0)
                panic("startup: no room for tables");
 
-       if ((vsize_t)(allocsys(v, NULL) - v) != size)
+       if ((vsize_t)(allocsys(v, mdallocsys) - v) != size)
                panic("startup: table size inconsistency");
 
-       if (CPU_ISSUN4C && bufpages > (128 * (65536/MAXBSIZE)))
-               bufpages = (128 * (65536/MAXBSIZE));
-
         /*
          * allocate virtual and physical memory for the buffers.
          */
@@ -310,6 +309,18 @@
        pmap_redzone();
 }
 
+caddr_t
+mdallocsys(v)
+       caddr_t v;
+{
+
+       /* Clip bufpages if necessary. */
+       if (CPU_ISSUN4C && bufpages > (128 * (65536/MAXBSIZE)))
+               bufpages = (128 * (65536/MAXBSIZE));
+
+       return (v);
+}
+
 /*
  * Set up registers on exec.
  *



Home | Main Index | Thread Index | Old Index