]> xenbits.xensource.com Git - seabios.git/commitdiff
Minor - clear unused f-segment data at start of f-segment.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 21 Jul 2012 15:56:09 +0000 (11:56 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 21 Jul 2012 15:56:09 +0000 (11:56 -0400)
Zero the space - some old applications can use the space for UMB if it
is zeroed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/pmm.c

index 1addb411574b160b23c31eb7b4cfff7f51cbfa3b..653c9e2a11b8b4e38c31f3a005b27400e4b9025e 100644 (file)
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -287,7 +287,6 @@ malloc_finalize(void)
     dprintf(3, "malloc finalize\n");
 
     // Place an optionrom signature around used low mem area.
-    struct allocinfo_s *info = findLast(&ZoneLow);
     u32 base = rom_get_top();
     struct rom_header *dummyrom = (void*)base;
     dummyrom->signature = OPTION_ROM_SIGNATURE;
@@ -296,6 +295,10 @@ malloc_finalize(void)
     memset((void*)RomEnd, 0, base-RomEnd);
     dprintf(1, "Space available for UMB: %08x-%08x\n", RomEnd, base);
 
+    // Clear unused f-seg ram.
+    struct allocinfo_s *info = findLast(&ZoneFSeg);
+    memset(info->dataend, 0, info->allocend - info->dataend);
+
     // Give back unused high ram.
     info = findLast(&ZoneHigh);
     if (info) {