From 6e04cb76dba579cf73f22d19e654dade1a17b5c0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 5 Sep 2020 14:50:37 -0600 Subject: [PATCH] x86: Update the bootparam header This header is missing a few of the newer features from the specification. Add these as well as a link to the spec. Also use the BIT() macros where appropriate. Signed-off-by: Simon Glass Reviewed-by: Wolfgang Wallner Reviewed-by: Bin Meng --- arch/x86/include/asm/bootparam.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h index d961dddc9e..7a3c1f5155 100644 --- a/arch/x86/include/asm/bootparam.h +++ b/arch/x86/include/asm/bootparam.h @@ -24,6 +24,11 @@ struct setup_data { __u8 data[0]; }; +/** + * struct setup_header - Information needed by Linux to boot + * + * See https://www.kernel.org/doc/html/latest/x86/boot.html + */ struct setup_header { __u8 setup_sects; __u16 root_flags; @@ -43,15 +48,16 @@ struct setup_header { __u16 kernel_version; __u8 type_of_loader; __u8 loadflags; -#define LOADED_HIGH (1<<0) -#define QUIET_FLAG (1<<5) -#define KEEP_SEGMENTS (1<<6) -#define CAN_USE_HEAP (1<<7) +#define LOADED_HIGH BIT(0) +#define KASLR_FLAG BIT(1) +#define QUIET_FLAG BIT(5) +#define KEEP_SEGMENTS BIT(6) /* Obsolete */ +#define CAN_USE_HEAP BIT(7) __u16 setup_move_size; __u32 code32_start; __u32 ramdisk_image; __u32 ramdisk_size; - __u32 bootsect_kludge; + __u32 bootsect_kludge; /* Obsolete */ __u16 heap_end_ptr; __u8 ext_loader_ver; __u8 ext_loader_type; @@ -59,7 +65,13 @@ struct setup_header { __u32 initrd_addr_max; __u32 kernel_alignment; __u8 relocatable_kernel; - __u8 _pad2[3]; + u8 min_alignment; +#define XLF_KERNEL_64 BIT(0) +#define XLF_CAN_BE_LOADED_ABOVE_4G BIT(1) +#define XLF_EFI_HANDOVER_32 BIT(2) +#define XLF_EFI_HANDOVER_64 BIT(3) +#define XLF_EFI_KEXEC BIT(4) + u16 xloadflags; __u32 cmdline_size; __u32 hardware_subarch; __u64 hardware_subarch_data; @@ -69,6 +81,7 @@ struct setup_header { __u64 pref_address; __u32 init_size; __u32 handover_offset; + u32 kernel_info_offset; } __attribute__((packed)); struct sys_desc_table {