diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-02-19 21:35:20 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-02-19 21:57:24 -0500 |
commit | 6d152646612f00f5e4792b3c32f659444ab16930 (patch) | |
tree | 7aafb4b152c0ec45b742fcb6b620e1247ba44aef /src/pmm.c | |
parent | f85e4bc030e38966b48e8085ba74f58b40603a46 (diff) | |
download | seabios-6d152646612f00f5e4792b3c32f659444ab16930.tar.gz |
Eliminate separate BiosTableSpace[] space for f-segment allocations.
The BiosTableSpace variable was used to ensure there was sufficient
space in the f-segment for malloc_fseg() calls. However, it added 2K
to the final image size to reserve that space.
Update the build to determine where to put the f-segment allocations.
In most cases (when code relocation is enabled) allocations can be
done in the space free'd from the "init" sections and no additional
space needs to be reserved in the final image. This also has the
benefit of not fragmenting the f-segment allocation space.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/pmm.c')
-rw-r--r-- | src/pmm.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -216,9 +216,6 @@ rom_confirm(u32 size) * Setup ****************************************************************/ -// Space for bios tables built an run-time. -char BiosTableSpace[CONFIG_MAX_BIOSTABLE] __aligned(MALLOC_MIN_ALIGN) VARFSEG; - void malloc_preinit(void) { @@ -320,12 +317,9 @@ malloc_init(void) RomBase = findLast(&ZoneLow); // Add space available in f-segment to ZoneFSeg - addSpace(&ZoneFSeg, BiosTableSpace, &BiosTableSpace[CONFIG_MAX_BIOSTABLE]); - extern u8 code32init_end[]; - if ((u32)code32init_end > BUILD_BIOS_ADDR) { - memset((void*)BUILD_BIOS_ADDR, 0, (u32)code32init_end - BUILD_BIOS_ADDR); - addSpace(&ZoneFSeg, (void*)BUILD_BIOS_ADDR, code32init_end); - } + extern u8 zonefseg_start[], zonefseg_end[]; + memset(zonefseg_start, 0, zonefseg_end - zonefseg_start); + addSpace(&ZoneFSeg, zonefseg_start, zonefseg_end); calcRamSize(); } |