HV: init mmap info with multiboot2

Initialize mmap info of acrn mbi when boot from multiboot2 protocol,
with this patch acrn hv could boot from multiboot2;

Tracked-On: #4419

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2020-02-17 10:36:08 +08:00
committed by wenlingz
parent d008b72fdd
commit b669a71931
4 changed files with 99 additions and 1 deletions

View File

@@ -8,6 +8,9 @@
#define BOOT_H_
#include <multiboot.h>
#ifdef CONFIG_MULTIBOOT2
#include <multiboot2.h>
#endif
#include <e820.h>
#define MAX_BOOTARGS_SIZE 2048U
@@ -37,6 +40,15 @@ static inline bool boot_from_multiboot1(void)
return ((boot_regs[0] == MULTIBOOT_INFO_MAGIC) && (boot_regs[1] != 0U));
}
#ifdef CONFIG_MULTIBOOT2
static inline bool boot_from_multiboot2(void)
{
return ((boot_regs[0] == MULTIBOOT2_INFO_MAGIC) && (boot_regs[1] != 0U));
}
int32_t multiboot2_to_acrn_mbi(struct acrn_multiboot_info *mbi, void *mb2_info);
#endif
struct acrn_multiboot_info *get_multiboot_info(void);
int32_t sanitize_multiboot_info(void);
void parse_hv_cmdline(void);