TianoCore EDK2 master
Loading...
Searching...
No Matches
QemuLoadImageLib.h File Reference
#include <Uefi/UefiBaseType.h>
#include <Base.h>
#include <Protocol/LoadedImage.h>

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI QemuLoadKernelImage (OUT EFI_HANDLE *ImageHandle)
 
EFI_STATUS EFIAPI QemuStartKernelImage (IN OUT EFI_HANDLE *ImageHandle)
 
EFI_STATUS EFIAPI QemuUnloadKernelImage (IN EFI_HANDLE ImageHandle)
 

Detailed Description

Load a kernel image and command line passed to QEMU via the command line

Copyright (C) 2020, Arm, Limited.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file QemuLoadImageLib.h.

Function Documentation

◆ QemuLoadKernelImage()

EFI_STATUS EFIAPI QemuLoadKernelImage ( OUT EFI_HANDLE ImageHandle)

Download the kernel, the initial ramdisk, and the kernel command line from QEMU's fw_cfg. The kernel will be instructed via its command line to load the initrd from the same Simple FileSystem where the kernel was loaded from.

Parameters
[out]ImageHandleThe image handle that was allocated for loading the image
Return values
EFI_SUCCESSThe image was loaded successfully.
EFI_NOT_FOUNDKernel image was not found.
EFI_OUT_OF_RESOURCESMemory allocation failed.
EFI_PROTOCOL_ERRORUnterminated kernel command line.
EFI_ACCESS_DENIEDThe underlying LoadImage boot service call returned EFI_SECURITY_VIOLATION, and the image was unloaded again.
Returns
Error codes from any of the underlying functions.

Download the kernel, the initial ramdisk, and the kernel command line from QEMU's fw_cfg. The kernel will be instructed via its command line to load the initrd from the same Simple FileSystem where the kernel was loaded from.

Parameters
[out]ImageHandleThe image handle that was allocated for loading the image
Return values
EFI_SUCCESSThe image was loaded successfully.
EFI_NOT_FOUNDKernel image was not found.
EFI_OUT_OF_RESOURCESMemory allocation failed.
EFI_PROTOCOL_ERRORUnterminated kernel command line.
Returns
Error codes from any of the underlying functions.

Definition at line 163 of file GenericQemuLoadImageLib.c.

◆ QemuStartKernelImage()

EFI_STATUS EFIAPI QemuStartKernelImage ( IN OUT EFI_HANDLE ImageHandle)

Transfer control to a kernel image loaded with QemuLoadKernelImage ()

Parameters
[in,out]ImageHandleHandle of image to be started. May assume a different value on return if the image was reloaded.
Return values
EFI_INVALID_PARAMETERImageHandle is either an invalid image handle or the image has already been initialized with StartImage
EFI_SECURITY_VIOLATIONThe current platform policy specifies that the image should not be started.
Returns
Error codes returned by the started image. On success, the function doesn't return.

Transfer control to a kernel image loaded with QemuLoadKernelImage ()

Parameters
[in,out]ImageHandleHandle of image to be started. May assume a different value on return if the image was reloaded.
Return values
EFI_INVALID_PARAMETERImageHandle is either an invalid image handle or the image has already been initialized with StartImage
EFI_SECURITY_VIOLATIONThe current platform policy specifies that the image should not be started.
Returns
Error codes returned by the started image

Definition at line 373 of file GenericQemuLoadImageLib.c.

◆ QemuUnloadKernelImage()

EFI_STATUS EFIAPI QemuUnloadKernelImage ( IN EFI_HANDLE  ImageHandle)

Unloads an image loaded with QemuLoadKernelImage ().

Parameters
ImageHandleHandle that identifies the image to be unloaded.
Return values
EFI_SUCCESSThe image has been unloaded.
EFI_UNSUPPORTEDThe image has been started, and does not support unload.
EFI_INVALID_PARAMETERImageHandle is not a valid image handle.
Returns
Exit code from the image's unload function.

Definition at line 399 of file GenericQemuLoadImageLib.c.