From bfc075fa6b361b8b86e011f79939b603a5a34d42 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Wed, 21 Sep 2022 10:42:40 +0200 Subject: [PATCH] stub: Rename image parameter This is really the parent image for the kernel that is to be run. Renaming it as such prevents confusion with any image handles that are about to be created. --- src/boot/efi/linux.c | 6 +++--- src/boot/efi/linux.h | 4 ++-- src/boot/efi/linux_x86.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/boot/efi/linux.c b/src/boot/efi/linux.c index 7771058c3a..1cebae34ec 100644 --- a/src/boot/efi/linux.c +++ b/src/boot/efi/linux.c @@ -93,7 +93,7 @@ static inline void cleanup_loaded_image(EFI_HANDLE *loaded_image_handle) { } EFI_STATUS linux_exec( - EFI_HANDLE image, + EFI_HANDLE parent, const char *cmdline, UINTN cmdline_len, const void *linux_buffer, UINTN linux_length, const void *initrd_buffer, UINTN initrd_length) { @@ -105,7 +105,7 @@ EFI_STATUS linux_exec( void *new_buffer; EFI_STATUS err; - assert(image); + assert(parent); assert(cmdline || cmdline_len == 0); assert(linux_buffer && linux_length > 0); assert(initrd_buffer || initrd_length == 0); @@ -117,7 +117,7 @@ EFI_STATUS linux_exec( /* Kernel is too old to support LINUX_INITRD_MEDIA_GUID, try the deprecated EFI handover * protocol. */ return linux_exec_efi_handover( - image, + parent, cmdline, cmdline_len, linux_buffer, diff --git a/src/boot/efi/linux.h b/src/boot/efi/linux.h index eab617e579..19e5f5c4a8 100644 --- a/src/boot/efi/linux.h +++ b/src/boot/efi/linux.h @@ -4,12 +4,12 @@ #include EFI_STATUS linux_exec( - EFI_HANDLE image, + EFI_HANDLE parent, const char *cmdline, UINTN cmdline_len, const void *linux_buffer, UINTN linux_length, const void *initrd_buffer, UINTN initrd_length); EFI_STATUS linux_exec_efi_handover( - EFI_HANDLE image, + EFI_HANDLE parent, const char *cmdline, UINTN cmdline_len, const void *linux_buffer, UINTN linux_length, const void *initrd_buffer, UINTN initrd_length); diff --git a/src/boot/efi/linux_x86.c b/src/boot/efi/linux_x86.c index c664abd461..64336ce348 100644 --- a/src/boot/efi/linux_x86.c +++ b/src/boot/efi/linux_x86.c @@ -99,10 +99,10 @@ assert_cc(sizeof(BootParams) == 4096); # define __regparm0__ #endif -typedef void (*handover_f)(void *image, EFI_SYSTEM_TABLE *table, BootParams *params) __regparm0__ +typedef void (*handover_f)(void *parent, EFI_SYSTEM_TABLE *table, BootParams *params) __regparm0__ __attribute__((sysv_abi)); -static void linux_efi_handover(EFI_HANDLE image, uintptr_t kernel, BootParams *params) { +static void linux_efi_handover(EFI_HANDLE parent, uintptr_t kernel, BootParams *params) { assert(params); kernel += (params->hdr.setup_sects + 1) * KERNEL_SECTOR_SIZE; /* 32bit entry address. */ @@ -121,16 +121,16 @@ static void linux_efi_handover(EFI_HANDLE image, uintptr_t kernel, BootParams *p * kernel to be booted from a 32bit sd-stub. */ handover_f handover = (handover_f) kernel; - handover(image, ST, params); + handover(parent, ST, params); } EFI_STATUS linux_exec_efi_handover( - EFI_HANDLE image, + EFI_HANDLE parent, const char *cmdline, UINTN cmdline_len, const void *linux_buffer, UINTN linux_length, const void *initrd_buffer, UINTN initrd_length) { - assert(image); + assert(parent); assert(cmdline || cmdline_len == 0); assert(linux_buffer); assert(initrd_buffer || initrd_length == 0); @@ -203,6 +203,6 @@ EFI_STATUS linux_exec_efi_handover( boot_params->hdr.ramdisk_size = initrd_length; boot_params->ext_ramdisk_size = ((uint64_t) initrd_length) >> 32; - linux_efi_handover(image, (uintptr_t) linux_buffer, boot_params); + linux_efi_handover(parent, (uintptr_t) linux_buffer, boot_params); return EFI_LOAD_ERROR; }