TianoCore EDK2 master
|
#include <Uefi.h>
#include <Base.h>
#include <Guid/QemuKernelLoaderFsMedia.h>
#include <Library/DebugLib.h>
#include <Library/FileHandleLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/QemuLoadImageLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleFileSystem.h>
Go to the source code of this file.
Data Structures | |
struct | KERNEL_FILE_DEVPATH |
struct | KERNEL_VENMEDIA_FILE_DEVPATH |
struct | SINGLE_VENMEDIA_NODE_DEVPATH |
Functions | |
STATIC EFI_STATUS | GetQemuKernelLoaderBlobSize (IN EFI_FILE_HANDLE Root, IN CHAR16 *FileName, OUT UINTN *Size) |
STATIC EFI_STATUS | ReadWholeQemuKernelLoaderBlob (IN EFI_FILE_HANDLE Root, IN CHAR16 *FileName, IN UINTN Size, OUT VOID *Buffer) |
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) |
Variables | |
STATIC CONST KERNEL_VENMEDIA_FILE_DEVPATH | mKernelDevicePath |
STATIC CONST SINGLE_VENMEDIA_NODE_DEVPATH | mQemuKernelLoaderFsDevicePath |
Generic implementation of QemuLoadImageLib library class interface.
Copyright (c) 2020, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file GenericQemuLoadImageLib.c.
STATIC EFI_STATUS GetQemuKernelLoaderBlobSize | ( | IN EFI_FILE_HANDLE | Root, |
IN CHAR16 * | FileName, | ||
OUT UINTN * | Size | ||
) |
Definition at line 75 of file GenericQemuLoadImageLib.c.
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.
[out] | ImageHandle | The image handle that was allocated for loading the image |
EFI_SUCCESS | The image was loaded successfully. |
EFI_NOT_FOUND | Kernel image was not found. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
EFI_PROTOCOL_ERROR | Unterminated kernel command line. |
EFI_ACCESS_DENIED | The underlying LoadImage boot service call returned EFI_SECURITY_VIOLATION, and the image was unloaded again. |
Definition at line 163 of file GenericQemuLoadImageLib.c.
EFI_STATUS EFIAPI QemuStartKernelImage | ( | IN OUT EFI_HANDLE * | ImageHandle | ) |
Transfer control to a kernel image loaded with QemuLoadKernelImage ()
[in,out] | ImageHandle | Handle of image to be started. May assume a different value on return if the image was reloaded. |
EFI_INVALID_PARAMETER | ImageHandle is either an invalid image handle or the image has already been initialized with StartImage |
EFI_SECURITY_VIOLATION | The current platform policy specifies that the image should not be started. |
Definition at line 373 of file GenericQemuLoadImageLib.c.
EFI_STATUS EFIAPI QemuUnloadKernelImage | ( | IN EFI_HANDLE | ImageHandle | ) |
Unloads an image loaded with QemuLoadKernelImage ().
ImageHandle | Handle that identifies the image to be unloaded. |
EFI_SUCCESS | The image has been unloaded. |
EFI_UNSUPPORTED | The image has been started, and does not support unload. |
EFI_INVALID_PARAMETER | ImageHandle is not a valid image handle. |
Definition at line 399 of file GenericQemuLoadImageLib.c.
STATIC EFI_STATUS ReadWholeQemuKernelLoaderBlob | ( | IN EFI_FILE_HANDLE | Root, |
IN CHAR16 * | FileName, | ||
IN UINTN | Size, | ||
OUT VOID * | Buffer | ||
) |
Definition at line 109 of file GenericQemuLoadImageLib.c.
STATIC CONST KERNEL_VENMEDIA_FILE_DEVPATH mKernelDevicePath |
Definition at line 41 of file GenericQemuLoadImageLib.c.
STATIC CONST SINGLE_VENMEDIA_NODE_DEVPATH mQemuKernelLoaderFsDevicePath |
Definition at line 60 of file GenericQemuLoadImageLib.c.