diff mbox series

[1/4] multiboot2: Advertise the load type

Message ID 20240313150439.791213-2-ross.lagerwall@citrix.com (mailing list archive)
State Superseded
Headers show
Series x86: Multiboot PE support | expand

Commit Message

Ross Lagerwall March 13, 2024, 3:04 p.m. UTC
Advertise the type of the multiboot2 binary we're building. For now,
it's always ELF.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/boot/head.S     | 3 +++
 xen/include/xen/multiboot2.h | 6 ++++++
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494db..015023915a72 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -90,6 +90,9 @@  multiboot2_header:
                    0x200000, /* Load address alignment (2 MiB). */ \
                    MULTIBOOT2_LOAD_PREFERENCE_HIGH
 
+        mb2ht_init MB2_HT(LOAD_TYPE), MB2_HT(OPTIONAL), \
+                   MULTIBOOT2_LOAD_TYPE_ELF
+
         /* Console flags tag. */
         mb2ht_init MB2_HT(CONSOLE_FLAGS), MB2_HT(OPTIONAL), \
                    MULTIBOOT2_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED
diff --git a/xen/include/xen/multiboot2.h b/xen/include/xen/multiboot2.h
index f79204020535..c3a46ad66184 100644
--- a/xen/include/xen/multiboot2.h
+++ b/xen/include/xen/multiboot2.h
@@ -60,6 +60,7 @@ 
 #define MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS_EFI32       8
 #define MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS_EFI64       9
 #define MULTIBOOT2_HEADER_TAG_RELOCATABLE               10
+#define MULTIBOOT2_HEADER_TAG_LOAD_TYPE                 11
 
 /* Header tag flags. */
 #define MULTIBOOT2_HEADER_TAG_REQUIRED                  0
@@ -113,6 +114,11 @@ 
 #define MULTIBOOT2_FRAMEBUFFER_TYPE_RGB                 1
 #define MULTIBOOT2_FRAMEBUFFER_TYPE_EGA_TEXT            2
 
+/* Load types. */
+#define MULTIBOOT2_LOAD_TYPE_ADDRESS                    0
+#define MULTIBOOT2_LOAD_TYPE_ELF                        1
+#define MULTIBOOT2_LOAD_TYPE_PE                         2
+
 #ifndef __ASSEMBLY__
 typedef struct {
     u32 total_size;