These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / seabios / src / e820map.c
similarity index 90%
rename from qemu/roms/seabios/src/memmap.c
rename to qemu/roms/seabios/src/e820map.c
index e03f8d0..39445cf 100644 (file)
@@ -5,7 +5,7 @@
 // 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
 
@@ -54,7 +54,6 @@ e820_type_name(u32 type)
     case E820_ACPI:     return "ACPI";
     case E820_NVS:      return "NVS";
     case E820_UNUSABLE: return "UNUSABLE";
-    case E820_HOLE:     return "HOLE";
     default:            return "UNKNOWN";
     }
 }
@@ -73,12 +72,14 @@ dump_map(void)
     }
 }
 
+#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.
@@ -136,9 +137,16 @@ add_e820(u64 start, u64 size, u32 type)
     //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();
 }