Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/arch/acorn32/stand/boot32 Pull up revision 1.19 (re...



details:   https://anonhg.NetBSD.org/src/rev/8da98532e223
branches:  netbsd-2-0
changeset: 561180:8da98532e223
user:      tron <tron%NetBSD.org@localhost>
date:      Sat May 29 21:22:38 2004 +0000

description:
Pull up revision 1.19 (requested by abs in ticket #404):
Adjust the reserved heap space based on memory size. This avoids running out
of heap on machines with large amounts of memory.  Tested on 33MB RISC OS 4
and 128MB RISC OS 5 machines.  Updated version to 3.40.

diffstat:

 sys/arch/acorn32/stand/boot32/boot32.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r ba79f8a8fb4f -r 8da98532e223 sys/arch/acorn32/stand/boot32/boot32.c
--- a/sys/arch/acorn32/stand/boot32/boot32.c    Sat May 29 21:22:31 2004 +0000
+++ b/sys/arch/acorn32/stand/boot32/boot32.c    Sat May 29 21:22:38 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot32.c,v 1.16.2.2 2004/05/22 17:11:58 he Exp $       */
+/*     $NetBSD: boot32.c,v 1.16.2.3 2004/05/29 21:22:38 tron Exp $     */
 
 /*-
  * Copyright (c) 2002 Reinoud Zandijk
@@ -42,6 +42,7 @@
 #include <arm/arm32/pte.h>
 #include <machine/bootconfig.h>
 
+extern char end[];
 
 /* debugging flags */
 int debug = 1;
@@ -159,8 +160,10 @@
        /* Get number of pages and the memorytablesize */
        osmemory_read_arrangement_table_size(&memory_table_size, &nbpp);
 
-       /* reserve some space for heap etc... 512 might be bigish though */
-       memory_image_size = (int) HIMEM - 512*1024;
+       /* Allocate 99% - (small fixed amount) of the heap for memory_image */
+       memory_image_size = (int)HIMEM - (int)end - 512 * 1024;
+       memory_image_size /= 100;
+       memory_image_size *= 99;
        if (memory_image_size <= 256*1024)
                panic("Insufficient memory");
 
@@ -175,9 +178,8 @@
        lastpage   = ((int) top_memory    / nbpp) - 1;
        totalpages = lastpage - firstpage;
 
-       printf("Got %ld memory pages each %d kilobytes to mess with.\n\n",
-                       totalpages, nbpp>>10
-               );
+       printf("Allocated %ld memory pages, each of %d kilobytes.\n\n",
+                       totalpages, nbpp>>10 );
 
        /*
         * Setup the relocation table. Its a simple array of 3 * 32 bit



Home | Main Index | Thread Index | Old Index