]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/QemuLoadImageLib.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / Library / QemuLoadImageLib.h
CommitLineData
28de1a55
AB
1/** @file\r
2 Load a kernel image and command line passed to QEMU via\r
3 the command line\r
4\r
5 Copyright (C) 2020, Arm, Limited.\r
6\r
7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
8**/\r
9\r
10#ifndef QEMU_LOAD_IMAGE_LIB_H__\r
11#define QEMU_LOAD_IMAGE_LIB_H__\r
12\r
13#include <Uefi/UefiBaseType.h>\r
14#include <Base.h>\r
15\r
16#include <Protocol/LoadedImage.h>\r
17\r
18/**\r
19 Download the kernel, the initial ramdisk, and the kernel command line from\r
20 QEMU's fw_cfg. The kernel will be instructed via its command line to load\r
21 the initrd from the same Simple FileSystem where the kernel was loaded from.\r
22\r
23 @param[out] ImageHandle The image handle that was allocated for\r
24 loading the image\r
25\r
26 @retval EFI_SUCCESS The image was loaded successfully.\r
27 @retval EFI_NOT_FOUND Kernel image was not found.\r
28 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
29 @retval EFI_PROTOCOL_ERROR Unterminated kernel command line.\r
30 @retval EFI_ACCESS_DENIED The underlying LoadImage boot service call\r
31 returned EFI_SECURITY_VIOLATION, and the image\r
32 was unloaded again.\r
33\r
34 @return Error codes from any of the underlying\r
35 functions.\r
36**/\r
37EFI_STATUS\r
38EFIAPI\r
39QemuLoadKernelImage (\r
ac0a286f 40 OUT EFI_HANDLE *ImageHandle\r
28de1a55
AB
41 );\r
42\r
43/**\r
44 Transfer control to a kernel image loaded with QemuLoadKernelImage ()\r
45\r
46 @param[in,out] ImageHandle Handle of image to be started. May assume a\r
47 different value on return if the image was\r
48 reloaded.\r
49\r
50 @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle\r
51 or the image has already been initialized with\r
52 StartImage\r
53 @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the\r
54 image should not be started.\r
55\r
56 @return Error codes returned by the started image.\r
57 On success, the function doesn't return.\r
58**/\r
59EFI_STATUS\r
60EFIAPI\r
61QemuStartKernelImage (\r
ac0a286f 62 IN OUT EFI_HANDLE *ImageHandle\r
28de1a55
AB
63 );\r
64\r
65/**\r
66 Unloads an image loaded with QemuLoadKernelImage ().\r
67\r
68 @param ImageHandle Handle that identifies the image to be\r
69 unloaded.\r
70\r
71 @retval EFI_SUCCESS The image has been unloaded.\r
72 @retval EFI_UNSUPPORTED The image has been started, and does not\r
73 support unload.\r
74 @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
75\r
76 @return Exit code from the image's unload function.\r
77**/\r
78EFI_STATUS\r
79EFIAPI\r
80QemuUnloadKernelImage (\r
ac0a286f 81 IN EFI_HANDLE ImageHandle\r
28de1a55
AB
82 );\r
83\r
84#endif\r