Skip to content

Commit

Permalink
x86: Don't use magic strings for EFI loader signature
Browse files Browse the repository at this point in the history
Introduce a symbol, EFI_LOADER_SIGNATURE instead of using the magic
strings, which also helps to reduce the amount of ifdeffery.

Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Link: http://lkml.kernel.org/r/1318848017-12301-1-git-send-email-matt@console-pimps.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Matt Fleming authored and H. Peter Anvin committed Dec 10, 2011
1 parent 8af21e7 commit f7d7d01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions arch/x86/include/asm/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#ifdef CONFIG_X86_32

#define EFI_LOADER_SIGNATURE "EL32"

extern unsigned long asmlinkage efi_call_phys(void *, ...);

#define efi_call_phys0(f) efi_call_phys(f)
Expand Down Expand Up @@ -35,6 +37,8 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);

#else /* !CONFIG_X86_32 */

#define EFI_LOADER_SIGNATURE "EL64"

extern u64 efi_call0(void *fp);
extern u64 efi_call1(void *fp, u64 arg1);
extern u64 efi_call2(void *fp, u64 arg1, u64 arg2);
Expand Down
7 changes: 1 addition & 6 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,7 @@ void __init setup_arch(char **cmdline_p)
#endif
#ifdef CONFIG_EFI
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
#ifdef CONFIG_X86_32
"EL32",
#else
"EL64",
#endif
4)) {
EFI_LOADER_SIGNATURE, 4)) {
efi_enabled = 1;
efi_memblock_x86_reserve_range();
}
Expand Down

0 comments on commit f7d7d01

Please sign in to comment.