From 2f400bad340e216544d51d42912365e43c9d97ca Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Tue, 1 Aug 2023 14:45:24 +0800 Subject: [PATCH] HV: elf_loader: introduce the multiboot_header data structure Define the multiboot_header data structure and MULTIBOOT_MEMORY related definitions. Tracked-On: #8642 Signed-off-by: Zhang Chen Signed-off-by: Victor Sun Reviewed-by: Junjie Mao --- hypervisor/boot/include/multiboot_std.h | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/hypervisor/boot/include/multiboot_std.h b/hypervisor/boot/include/multiboot_std.h index 8988d53313..d0578b1a81 100644 --- a/hypervisor/boot/include/multiboot_std.h +++ b/hypervisor/boot/include/multiboot_std.h @@ -48,6 +48,36 @@ #define MULTIBOOT_INFO_HAS_LOADER_NAME 0x00000200U #ifndef ASSEMBLER + +struct multiboot_header { + /* Must be MULTIBOOT_MAGIC - see above. */ + uint32_t magic; + + /* Feature flags. */ + uint32_t flags; + + /* The above fields plus this one must equal 0 mod 2^32. */ + uint32_t checksum; + + /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */ + uint32_t header_addr; + uint32_t load_addr; + uint32_t load_end_addr; + uint32_t bss_end_addr; + uint32_t entry_addr; + + /* These are only valid if MULTIBOOT_VIDEO_MODE is set. */ + uint32_t mode_type; + uint32_t width; + uint32_t height; + uint32_t depth; +} __packed; + +#define MULTIBOOT_MEMORY_AVAILABLE 1U +#define MULTIBOOT_MEMORY_RESERVED 2U +#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3U +#define MULTIBOOT_MEMORY_NVS 4U +#define MULTIBOOT_MEMORY_BADRAM 5U struct multiboot_mmap { uint32_t size; uint64_t baseaddr;