|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 2/7] x86/kexec: rename setup_header to bzimage_header
From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
The newly named bzimage_header is moved to a header file because part of
it will be needed for Secure Boot kexec.
Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
Signed-off-by: Kevin Lampis <klampis@xxxxxxxxxx>
---
xen/arch/x86/bzimage.c | 47 +++---------------------------
xen/arch/x86/include/asm/bzimage.h | 39 +++++++++++++++++++++++++
2 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index 66f648f311..0bbd8b2758 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -13,48 +13,9 @@ static __init unsigned long output_length(void *image,
unsigned long image_len)
return *(uint32_t *)(image + image_len - 4);
}
-struct __packed setup_header {
- uint8_t _pad0[0x1f1]; /* skip uninteresting stuff */
- uint8_t setup_sects;
- uint16_t root_flags;
- uint32_t syssize;
- uint16_t ram_size;
- uint16_t vid_mode;
- uint16_t root_dev;
- uint16_t boot_flag;
- uint16_t jump;
- uint32_t header;
-#define HDR_MAGIC "HdrS"
-#define HDR_MAGIC_SZ 4
- uint16_t version;
-#define VERSION(h,l) (((h)<<8) | (l))
- uint32_t realmode_swtch;
- uint16_t start_sys;
- uint16_t kernel_version;
- uint8_t type_of_loader;
- uint8_t loadflags;
- uint16_t setup_move_size;
- uint32_t code32_start;
- uint32_t ramdisk_image;
- uint32_t ramdisk_size;
- uint32_t bootsect_kludge;
- uint16_t heap_end_ptr;
- uint16_t _pad1;
- uint32_t cmd_line_ptr;
- uint32_t initrd_addr_max;
- uint32_t kernel_alignment;
- uint8_t relocatable_kernel;
- uint8_t _pad2[3];
- uint32_t cmdline_size;
- uint32_t hardware_subarch;
- uint64_t hardware_subarch_data;
- uint32_t payload_offset;
- uint32_t payload_length;
- };
-
-static __init int bzimage_check(struct setup_header *hdr, unsigned long len)
+static __init int bzimage_check(struct bzimage_header *hdr, unsigned long len)
{
- if ( len < sizeof(struct setup_header) )
+ if ( len < sizeof(struct bzimage_header) )
return 0;
if ( memcmp(&hdr->header, HDR_MAGIC, HDR_MAGIC_SZ) != 0 )
@@ -73,7 +34,7 @@ static unsigned long __initdata orig_image_len;
unsigned long __init bzimage_headroom(void *image_start,
unsigned long image_length)
{
- struct setup_header *hdr = (struct setup_header *)image_start;
+ struct bzimage_header *hdr = (struct bzimage_header *)image_start;
int err;
unsigned long headroom;
@@ -106,7 +67,7 @@ unsigned long __init bzimage_headroom(void *image_start,
int __init bzimage_parse(void *image_base, void **image_start,
unsigned long *image_len)
{
- struct setup_header *hdr = (struct setup_header *)(*image_start);
+ struct bzimage_header *hdr = (struct bzimage_header *)(*image_start);
int err = bzimage_check(hdr, *image_len);
unsigned long output_len;
diff --git a/xen/arch/x86/include/asm/bzimage.h
b/xen/arch/x86/include/asm/bzimage.h
index 7ed69d3910..8c54b21d06 100644
--- a/xen/arch/x86/include/asm/bzimage.h
+++ b/xen/arch/x86/include/asm/bzimage.h
@@ -8,4 +8,43 @@ unsigned long bzimage_headroom(void *image_start, unsigned
long image_length);
int bzimage_parse(void *image_base, void **image_start,
unsigned long *image_len);
+struct __packed bzimage_header {
+ uint8_t _pad0[0x1f1]; /* skip uninteresting stuff */
+ uint8_t setup_sects;
+ uint16_t root_flags;
+ uint32_t syssize;
+ uint16_t ram_size;
+ uint16_t vid_mode;
+ uint16_t root_dev;
+ uint16_t boot_flag;
+ uint16_t jump;
+ uint32_t header;
+#define HDR_MAGIC "HdrS"
+#define HDR_MAGIC_SZ 4
+ uint16_t version;
+#define VERSION(h,l) (((h)<<8) | (l))
+ uint32_t realmode_swtch;
+ uint16_t start_sys;
+ uint16_t kernel_version;
+ uint8_t type_of_loader;
+ uint8_t loadflags;
+ uint16_t setup_move_size;
+ uint32_t code32_start;
+ uint32_t ramdisk_image;
+ uint32_t ramdisk_size;
+ uint32_t bootsect_kludge;
+ uint16_t heap_end_ptr;
+ uint16_t _pad1;
+ uint32_t cmd_line_ptr;
+ uint32_t initrd_addr_max;
+ uint32_t kernel_alignment;
+ uint8_t relocatable_kernel;
+ uint8_t _pad2[3];
+ uint32_t cmdline_size;
+ uint32_t hardware_subarch;
+ uint64_t hardware_subarch_data;
+ uint32_t payload_offset;
+ uint32_t payload_length;
+ };
+
#endif /* __X86_BZIMAGE_H__ */
--
2.52.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |