1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

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.
This commit is contained in:
Jan Janssen 2022-09-21 10:42:40 +02:00
parent 714c586943
commit bfc075fa6b
3 changed files with 11 additions and 11 deletions

View 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,

View 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);

View 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;
}