Commit 3245f02d authored by Leif Lindholm's avatar Leif Lindholm Committed by Daniel Kiper

make GRUB_LINUX_MAGIC_SIGNATURE architecture-specific

Rename GRUB_LINUX_MAGIC_SIGNATURE GRUB_LINUX_I386_MAGIC_SIGNATURE,
to be usable in code that supports more than one image type.
Signed-off-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
parent 8776e5a9
...@@ -508,7 +508,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) ...@@ -508,7 +508,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
/* FIXME: some really old kernels (< 1.3.73) will fail this. */ /* FIXME: some really old kernels (< 1.3.73) will fail this. */
if (lh.header != if (lh.header !=
grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
|| grub_le_to_cpu16 (lh.version) < 0x0200) || grub_le_to_cpu16 (lh.version) < 0x0200)
break; break;
...@@ -521,7 +521,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) ...@@ -521,7 +521,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
/* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and
still not support 32-bit boot. */ still not support 32-bit boot. */
if (lh.header != if (lh.header !=
grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
|| grub_le_to_cpu16 (lh.version) < 0x0203) || grub_le_to_cpu16 (lh.version) < 0x0203)
break; break;
......
...@@ -721,7 +721,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), ...@@ -721,7 +721,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
/* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and
still not support 32-bit boot. */ still not support 32-bit boot. */
if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
|| grub_le_to_cpu16 (lh.version) < 0x0203) || grub_le_to_cpu16 (lh.version) < 0x0203)
{ {
grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot" grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot"
......
...@@ -169,7 +169,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), ...@@ -169,7 +169,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
maximal_cmdline_size = 256; maximal_cmdline_size = 256;
if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
&& grub_le_to_cpu16 (lh.version) >= 0x0200) && grub_le_to_cpu16 (lh.version) >= 0x0200)
{ {
grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL); grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL);
...@@ -322,7 +322,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), ...@@ -322,7 +322,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail; goto fail;
} }
if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
|| grub_le_to_cpu16 (lh.version) < 0x0200) || grub_le_to_cpu16 (lh.version) < 0x0200)
/* Clear the heap space. */ /* Clear the heap space. */
grub_memset (grub_linux_real_chunk grub_memset (grub_linux_real_chunk
...@@ -407,7 +407,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), ...@@ -407,7 +407,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
lh = (struct linux_kernel_header *) grub_linux_real_chunk; lh = (struct linux_kernel_header *) grub_linux_real_chunk;
if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
&& grub_le_to_cpu16 (lh->version) >= 0x0200)) && grub_le_to_cpu16 (lh->version) >= 0x0200))
{ {
grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd"); grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd");
......
...@@ -43,7 +43,7 @@ grub_xen_file (grub_file_t file) ...@@ -43,7 +43,7 @@ grub_xen_file (grub_file_t file)
goto fail; goto fail;
if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55) if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)
|| lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
|| grub_le_to_cpu16 (lh.version) < 0x0208) || grub_le_to_cpu16 (lh.version) < 0x0208)
{ {
grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot"); grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot");
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef GRUB_I386_LINUX_HEADER #ifndef GRUB_I386_LINUX_HEADER
#define GRUB_I386_LINUX_HEADER 1 #define GRUB_I386_LINUX_HEADER 1
#define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ #define GRUB_LINUX_I386_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */
#define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4
#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF #define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF
#define GRUB_LINUX_MAX_SETUP_SECTS 64 #define GRUB_LINUX_MAX_SETUP_SECTS 64
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment