arm64/linux/loader: Rename functions and macros and move to common headers

In preparation for using the linux loader for 32-bit and 64-bit platforms,
rename grub_arm64*/GRUB_ARM64* to grub_armxx*/GRUB_ARMXX*.

Move prototypes for now-common functions to efi/efi.h.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Leif Lindholm 2018-07-09 18:33:02 +01:00 committed by Daniel Kiper
parent bad144c60f
commit d24dd12086
4 changed files with 20 additions and 17 deletions

View file

@ -48,9 +48,9 @@ static grub_addr_t initrd_start;
static grub_addr_t initrd_end;
grub_err_t
grub_arm64_uefi_check_image (struct linux_arm64_kernel_header * lh)
grub_armxx_efi_linux_check_image (struct linux_armxx_kernel_header * lh)
{
if (lh->magic != GRUB_LINUX_ARM64_MAGIC_SIGNATURE)
if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE)
return grub_error(GRUB_ERR_BAD_OS, "invalid magic number");
if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC)
@ -109,7 +109,7 @@ failure:
}
grub_err_t
grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args)
grub_armxx_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
{
grub_efi_memory_mapped_device_path_t *mempath;
grub_efi_handle_t image_handle;
@ -172,8 +172,8 @@ grub_linux_boot (void)
if (finalize_params_linux () != GRUB_ERR_NONE)
return grub_errno;
return (grub_arm64_uefi_boot_image((grub_addr_t)kernel_addr,
kernel_size, linux_args));
return (grub_armxx_efi_linux_boot_image((grub_addr_t)kernel_addr,
kernel_size, linux_args));
}
static grub_err_t
@ -249,7 +249,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
grub_file_t file = 0;
struct linux_arm64_kernel_header lh;
struct linux_armxx_kernel_header lh;
grub_dl_ref (my_mod);
@ -268,7 +268,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (grub_file_read (file, &lh, sizeof (lh)) < (long) sizeof (lh))
return grub_errno;
if (grub_arm64_uefi_check_image (&lh) != GRUB_ERR_NONE)
if (grub_armxx_efi_linux_check_image (&lh) != GRUB_ERR_NONE)
goto fail;
grub_loader_unset();