]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
efi: Add GRUB_PE32_MAGIC definition
authorLeif Lindholm <leif.lindholm@linaro.org>
Thu, 3 Aug 2017 10:04:25 +0000 (11:04 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 7 Aug 2017 16:52:09 +0000 (18:52 +0200)
Add a generic GRUB_PE32_MAGIC definition for the PE 'MZ' tag and delete
the existing one in arm64/linux.h.

Update arm64 Linux loader to use this new definition.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
grub-core/loader/arm64/linux.c
include/grub/arm64/linux.h
include/grub/efi/pe32.h

index 3e2f9b74296c9862346086a581ce58fc239e0d51..a652ee9088e0bb0e4f362d8b41a17d6ffcc848e1 100644 (file)
@@ -52,7 +52,7 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh)
   if (lh->magic != GRUB_ARM64_LINUX_MAGIC)
     return grub_error(GRUB_ERR_BAD_OS, "invalid magic number");
 
-  if ((lh->code0 & 0xffff) != GRUB_EFI_PE_MAGIC)
+  if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC)
     return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
                       N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled"));
 
index 1ea23696e7a096e53075af2314da11ecce91f8d7..a981df5d15f5f186935af0648da2408ac613f796 100644 (file)
@@ -23,8 +23,6 @@
 
 #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */
 
-#define GRUB_EFI_PE_MAGIC      0x5A4D
-
 /* From linux/Documentation/arm64/booting.txt */
 struct grub_arm64_linux_kernel_header
 {
index f79c36c026e0a518b3f9edaca36251d6d4943757..7d44732d2c353b74271262a1cf094d4aafd8dd10 100644 (file)
@@ -45,6 +45,8 @@
 
 #define GRUB_PE32_MSDOS_STUB_SIZE      0x80
 
+#define GRUB_PE32_MAGIC                        0x5a4d
+
 /* According to the spec, the minimal alignment is 512 bytes...
    But some examples (such as EFI drivers in the Intel
    Sample Implementation) use 32 bytes (0x20) instead, and it seems