summaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-09-29 09:40:46 -0400
committerKevin O'Connor <kevin@koconnor.net>2015-10-15 10:52:13 -0400
commitc167e54533124f3eaf3f2caa09e3022196573bec (patch)
tree61eb5313ff2b672585c6dbcc214d4a80592b0465 /src/malloc.c
parent8e385143b7656914052e386a885d8fee44593ca3 (diff)
downloadqemu-seabios-c167e54533124f3eaf3f2caa09e3022196573bec.tar.gz
e820: Rename memmap.c to e820map.c and use consistent "e820_" prefix
Rename memmap.c to e820map.c as the code in that file only deals with maintaining the e820 map. Move all the e820 definitions to new file e820map.h and use a consistent "e820_" prefix on all exported functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 5c05a8a..efd09b3 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -6,9 +6,10 @@
#include "biosvar.h" // GET_BDA
#include "config.h" // BUILD_BIOS_ADDR
+#include "e820map.h" // struct e820entry
#include "list.h" // hlist_node
#include "malloc.h" // _malloc
-#include "memmap.h" // struct e820entry
+#include "memmap.h" // PAGE_SIZE
#include "output.h" // dprintf
#include "stacks.h" // wait_preempt
#include "std/optionrom.h" // OPTION_ROM_ALIGN
@@ -399,7 +400,7 @@ malloc_preinit(void)
e820_remove(BUILD_LOWRAM_END, BUILD_BIOS_ADDR-BUILD_LOWRAM_END);
// Mark known areas as reserved.
- add_e820(BUILD_BIOS_ADDR, BUILD_BIOS_SIZE, E820_RESERVED);
+ e820_add(BUILD_BIOS_ADDR, BUILD_BIOS_SIZE, E820_RESERVED);
// Populate temp high ram
u32 highram = 0;
@@ -427,7 +428,7 @@ malloc_preinit(void)
if (highram) {
addSpace(&ZoneHigh, (void*)highram
, (void*)highram + BUILD_MAX_HIGHTABLE);
- add_e820(highram, BUILD_MAX_HIGHTABLE, E820_RESERVED);
+ e820_add(highram, BUILD_MAX_HIGHTABLE, E820_RESERVED);
}
}
@@ -521,7 +522,7 @@ malloc_prepboot(void)
// Reserve more low-mem if needed.
u32 endlow = GET_BDA(mem_size_kb)*1024;
- add_e820(endlow, BUILD_LOWRAM_END-endlow, E820_RESERVED);
+ e820_add(endlow, BUILD_LOWRAM_END-endlow, E820_RESERVED);
// Clear unused f-seg ram.
struct allocinfo_s *info = findLast(&ZoneFSeg);
@@ -533,7 +534,7 @@ malloc_prepboot(void)
info = findLast(&ZoneHigh);
if (info) {
u32 giveback = ALIGN_DOWN(info->allocend - info->dataend, PAGE_SIZE);
- add_e820((u32)info->dataend, giveback, E820_RAM);
+ e820_add((u32)info->dataend, giveback, E820_RAM);
dprintf(1, "Returned %d bytes of ZoneHigh\n", giveback);
}