Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/acorn32/stand/boot32 Adjust the reserved heap space...



details:   https://anonhg.NetBSD.org/src/rev/216750fa609e
branches:  trunk
changeset: 566975:216750fa609e
user:      abs <abs%NetBSD.org@localhost>
date:      Wed May 26 23:13:03 2004 +0000

description:
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 ++++++++------
 sys/arch/acorn32/stand/boot32/version  |   5 +++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diffs (64 lines):

diff -r 9ddc83cec256 -r 216750fa609e sys/arch/acorn32/stand/boot32/boot32.c
--- a/sys/arch/acorn32/stand/boot32/boot32.c    Wed May 26 23:00:32 2004 +0000
+++ b/sys/arch/acorn32/stand/boot32/boot32.c    Wed May 26 23:13:03 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot32.c,v 1.18 2004/05/19 23:37:41 abs Exp $  */
+/*     $NetBSD: boot32.c,v 1.19 2004/05/26 23:13:03 abs 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
diff -r 9ddc83cec256 -r 216750fa609e sys/arch/acorn32/stand/boot32/version
--- a/sys/arch/acorn32/stand/boot32/version     Wed May 26 23:00:32 2004 +0000
+++ b/sys/arch/acorn32/stand/boot32/version     Wed May 26 23:13:03 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.8 2004/05/19 23:37:41 abs Exp $
+$NetBSD: version,v 1.9 2004/05/26 23:13:05 abs Exp $
 
 0.90:  Experimental C version
 0.91:  General cleanup
@@ -17,10 +17,11 @@
 3.00:  acorn32 bootloader version 3 is alive
 3.01:  fixed serious non VRAM screen issues and made NC live again!
 3.02:  first small try for bootfile name fixing
-3.03:  no zeropage useage anymore
+3.03:  no zeropage usage anymore
 3.04:  fixed physical memory blocks searching; it was a sorting error
 3.05:  fixed printing of videomem useage
 3.06:  fixed non 1Mb-alignment problems for the top 1Mb in the memorymap
 3.10:  Serious loading problems fixed and cleanup code
 3.20:  Redone videomem mapping and top memory search; esp. for smaller machines
 3.30:  Use qsort to significantly speed memory sort
+3.40:  Adjust reserved heap space based on memory size



Home | Main Index | Thread Index | Old Index