[OpenBIOS] [commit] r923 - trunk/openbios-devel/arch/sparc32

repository service svn at openbios.org
Thu Oct 28 22:53:59 CEST 2010


Author: mcayland
Date: Thu Oct 28 22:53:58 2010
New Revision: 923
URL: http://tracker.coreboot.org/trac/openbios/changeset/923

Log:
Change SPARC32 memory allocator to allocate memory starting from just below the OpenBIOS image downwards.

The existing code appeared to be allocating memory from the wrong property (map rather than avail) and so rather than allocating 
memory starting from just below the OpenBIOS image downwards, it was simply reducing the reported size of the OpenBIOS image.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>

Modified:
   trunk/openbios-devel/arch/sparc32/lib.c

Modified: trunk/openbios-devel/arch/sparc32/lib.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/lib.c	Mon Oct 25 22:48:45 2010	(r922)
+++ trunk/openbios-devel/arch/sparc32/lib.c	Thu Oct 28 22:53:58 2010	(r923)
@@ -451,9 +451,9 @@
 
     size = (size + 7) & ~7;
     // XXX should use normal memory alloc
-    totmap[0].num_bytes -= size;
+    totavail[0].num_bytes -= size;
     DPRINTF("obp_dumb_memalloc va 0x%p size %x at 0x%x\n", va, size,
-            totmap[0].num_bytes);
+            totavail[0].num_bytes);
 
     // If va is null, the allocator is supposed to pick a "suitable" address.
     // (See OpenSolaric prom_alloc.c)  There's not any real guidance as
@@ -467,7 +467,7 @@
         DPRINTF("obp_dumb_memalloc req null -> 0x%p\n", va);
     }
 
-    map_pages((unsigned long)va, totmap[0].num_bytes, 0, size);
+    map_pages((unsigned long)va, totavail[0].num_bytes, 0, size);
 
     return va;
 }



More information about the OpenBIOS mailing list