]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stub: Rename image parameter
authorJan Janssen <medhefgo@web.de>
Wed, 21 Sep 2022 08:42:40 +0000 (10:42 +0200)
committerJan Janssen <medhefgo@web.de>
Mon, 17 Oct 2022 12:41:26 +0000 (14:41 +0200)
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
src/boot/efi/linux.h
src/boot/efi/linux_x86.c

index 7771058c3a2e4c375687dbd3403a8652021ddd4a..1cebae34ece4c23f20047ba2419ac0dd703bae59 100644 (file)
@@ -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,
index eab617e579877b46881f177d3eb8969bd652b839..19e5f5c4a8180192b4926b60363cb8ddd76fca46 100644 (file)
@@ -4,12 +4,12 @@
 #include <efi.h>
 
 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);
index c664abd46138556e6fb3ffa4d07bfc788af4407a..64336ce348eedbca5c12bb33f024561a3ef0a2bf 100644 (file)
@@ -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;
 }