From 36d943f6d371b85fef97514160cd9f9124a57ae9 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Thu, 28 Oct 2010 20:53:58 +0000 Subject: [PATCH] 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 git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@923 f158a5a8-5612-0410-a976-696ce0be7e32 --- arch/sparc32/lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/sparc32/lib.c b/arch/sparc32/lib.c index 9f4f0ac..15644fe 100644 --- a/arch/sparc32/lib.c +++ b/arch/sparc32/lib.c @@ -451,9 +451,9 @@ char *obp_dumb_memalloc(char *va, unsigned int size) 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 @@ char *obp_dumb_memalloc(char *va, unsigned int size) 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; }