Re: [SeaBIOS] [PATCH] Move malloc's ZoneFSeg and ZoneLow setup to malloc_init.

2013-02-19 Thread David Woodhouse
On Tue, 2013-02-19 at 01:38 -0500, Kevin O'Connor wrote:
 This reduces some duplicate code between malloc_preinit() and
 csm_malloc_preinit().
 
 Signed-off-by: Kevin O'Connor ke...@koconnor.net

Nice. I was planning to reduce that duplication, and this seems ideal.
Thanks.

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios


[SeaBIOS] [PATCH] Move malloc's ZoneFSeg and ZoneLow setup to malloc_init.

2013-02-18 Thread Kevin O'Connor
This reduces some duplicate code between malloc_preinit() and
csm_malloc_preinit().

Signed-off-by: Kevin O'Connor ke...@koconnor.net
---
 src/pmm.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/pmm.c b/src/pmm.c
index 0bd30b2..c717884 100644
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -254,12 +254,8 @@ malloc_preinit(void)
 addSpace(ZoneTmpHigh, (void*)s, (void*)e);
 }
 
-// Populate other regions
+// Populate regions
 addSpace(ZoneTmpLow, (void*)BUILD_STACK_ADDR, (void*)BUILD_EBDA_MINIMUM);
-addSpace(ZoneFSeg, BiosTableSpace, BiosTableSpace[CONFIG_MAX_BIOSTABLE]);
-extern u8 final_varlow_start[];
-addSpace(ZoneLow, zonelow_base + OPROM_HEADER_RESERVE, 
final_varlow_start);
-RomBase = findLast(ZoneLow);
 if (highram) {
 addSpace(ZoneHigh, (void*)highram
  , (void*)highram + CONFIG_MAX_HIGHTABLE);
@@ -280,10 +276,6 @@ csm_malloc_preinit(u32 low_pmm, u32 low_pmm_size, u32 
hi_pmm, u32 hi_pmm_size)
 addSpace(ZoneTmpHigh, (void *)hi_pmm, (void *)hi_pmm + hi_pmm_size);
 }
 addSpace(ZoneTmpLow, (void *)low_pmm, (void *)low_pmm + low_pmm_size);
-addSpace(ZoneFSeg, BiosTableSpace, BiosTableSpace[CONFIG_MAX_BIOSTABLE]);
-extern u8 final_varlow_start[];
-addSpace(ZoneLow, zonelow_base + OPROM_HEADER_RESERVE, 
final_varlow_start);
-RomBase = findLast(ZoneLow);
 }
 
 // Update pointers after code relocation.
@@ -303,11 +295,14 @@ malloc_init(void)
 }
 }
 
-// Move low-memory initial variable content to new location.
+// Initialize low-memory region
 extern u8 varlow_start[], varlow_end[], final_varlow_start[];
 memmove(final_varlow_start, varlow_start, varlow_end - varlow_start);
+addSpace(ZoneLow, zonelow_base + OPROM_HEADER_RESERVE, 
final_varlow_start);
+RomBase = findLast(ZoneLow);
 
 // Add space available in f-segment to ZoneFSeg
+addSpace(ZoneFSeg, BiosTableSpace, BiosTableSpace[CONFIG_MAX_BIOSTABLE]);
 extern u8 final_code32flat_start[];
 if ((u32)final_code32flat_start  BUILD_BIOS_ADDR) {
 memset((void*)BUILD_BIOS_ADDR, 0
-- 
1.7.11.7


___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios