Transition the memory map info to be held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <[email protected]>
---
 xen/arch/x86/include/asm/bootinfo.h |  5 +++++
 xen/arch/x86/setup.c                | 12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h 
b/xen/arch/x86/include/asm/bootinfo.h
index d2ca077d2356..e785ed1c5982 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -8,11 +8,16 @@
 #ifndef __XEN_X86_BOOTINFO_H__
 #define __XEN_X86_BOOTINFO_H__
 
+#include <xen/types.h>
+
 struct boot_info {
     unsigned int nr_mods;
 
     const char *boot_loader_name;
     const char *cmdline;
+
+    paddr_t mmap_addr;
+    uint32_t mmap_length;
 };
 
 #endif
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a945fa10555f..c6b45ced00ae 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -297,6 +297,12 @@ static void __init multiboot_to_bootinfo(multiboot_info_t 
*mbi)
     else
         info.cmdline = "";
 
+    if ( mbi->flags & MBI_MEMMAP )
+    {
+        info.mmap_addr = mbi->mmap_addr;
+        info.mmap_length = mbi->mmap_length;
+    }
+
     boot_info = &info;
 }
 
@@ -1200,13 +1206,13 @@ void asmlinkage __init noreturn __start_xen(unsigned 
long mbi_p)
     {
         memmap_type = "Xen-e820";
     }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else if ( boot_info->mmap_addr )
     {
         memmap_type = "Multiboot-e820";
-        while ( bytes < mbi->mmap_length &&
+        while ( bytes < boot_info->mmap_length &&
                 e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) )
         {
-            memory_map_t *map = __va(mbi->mmap_addr + bytes);
+            memory_map_t *map = __va(boot_info->mmap_addr + bytes);
 
             /*
              * This is a gross workaround for a BIOS bug. Some bootloaders do
-- 
2.30.2


Reply via email to