2 Load a kernel image and command line passed to QEMU via
5 Copyright (C) 2020, Arm, Limited.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef QEMU_LOAD_IMAGE_LIB_H__
11 #define QEMU_LOAD_IMAGE_LIB_H__
13 #include <Uefi/UefiBaseType.h>
16 #include <Protocol/LoadedImage.h>
19 Download the kernel, the initial ramdisk, and the kernel command line from
20 QEMU's fw_cfg. The kernel will be instructed via its command line to load
21 the initrd from the same Simple FileSystem where the kernel was loaded from.
23 @param[out] ImageHandle The image handle that was allocated for
26 @retval EFI_SUCCESS The image was loaded successfully.
27 @retval EFI_NOT_FOUND Kernel image was not found.
28 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
29 @retval EFI_PROTOCOL_ERROR Unterminated kernel command line.
30 @retval EFI_ACCESS_DENIED The underlying LoadImage boot service call
31 returned EFI_SECURITY_VIOLATION, and the image
34 @return Error codes from any of the underlying
40 OUT EFI_HANDLE
*ImageHandle
44 Transfer control to a kernel image loaded with QemuLoadKernelImage ()
46 @param[in,out] ImageHandle Handle of image to be started. May assume a
47 different value on return if the image was
50 @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle
51 or the image has already been initialized with
53 @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the
54 image should not be started.
56 @return Error codes returned by the started image.
57 On success, the function doesn't return.
61 QemuStartKernelImage (
62 IN OUT EFI_HANDLE
*ImageHandle
66 Unloads an image loaded with QemuLoadKernelImage ().
68 @param ImageHandle Handle that identifies the image to be
71 @retval EFI_SUCCESS The image has been unloaded.
72 @retval EFI_UNSUPPORTED The image has been started, and does not
74 @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
76 @return Exit code from the image's unload function.
80 QemuUnloadKernelImage (
81 IN EFI_HANDLE ImageHandle