// This file may be distributed under the terms of the GNU LGPLv3 license.
#include "config.h" // BUILD_MAX_E820
-#include "memmap.h" // struct e820entry
+#include "e820map.h" // struct e820entry
#include "output.h" // dprintf
#include "string.h" // memmove
case E820_ACPI: return "ACPI";
case E820_NVS: return "NVS";
case E820_UNUSABLE: return "UNUSABLE";
- case E820_HOLE: return "HOLE";
default: return "UNKNOWN";
}
}
}
}
+#define E820_HOLE ((u32)-1) // Used internally to remove entries
+
// Add a new entry to the list. This scans for overlaps and keeps the
// list sorted.
void
-add_e820(u64 start, u64 size, u32 type)
+e820_add(u64 start, u64 size, u32 type)
{
- dprintf(8, "Add to e820 map: %08x %08x %d\n", (u32)start, (u32)size, type);
+ dprintf(8, "Add to e820 map: %08llx %08llx %d\n", start, size, type);
if (! size)
// Huh? Nothing to do.
//dump_map();
}
+// Remove any definitions in a memory range (make a memory hole).
+void
+e820_remove(u64 start, u64 size)
+{
+ e820_add(start, size, E820_HOLE);
+}
+
// Report on final memory locations.
void
-memmap_prepboot(void)
+e820_prepboot(void)
{
dump_map();
}