]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/QemuBootOrderLib.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / Library / QemuBootOrderLib.h
CommitLineData
2cd086a6 1/** @file\r
2 Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file --\r
3 include file.\r
4\r
cca7475b 5 Copyright (C) 2012-2014, Red Hat, Inc.\r
2cd086a6 6\r
b26f0cf9 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
2cd086a6 8**/\r
9\r
cca7475b
LE
10#ifndef __QEMU_BOOT_ORDER_LIB_H__\r
11#define __QEMU_BOOT_ORDER_LIB_H__\r
2cd086a6 12\r
13#include <Uefi/UefiBaseType.h>\r
14#include <Base.h>\r
15\r
51bd1f76
LE
16/**\r
17 Connect devices based on the boot order retrieved from QEMU.\r
18\r
19 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the\r
20 OpenFirmware device paths therein to UEFI device path fragments. Connect the\r
21 devices identified by the UEFI devpath prefixes as narrowly as possible, then\r
22 connect all their child devices, recursively.\r
23\r
24 If this function fails, then platform BDS should fall back to\r
25 EfiBootManagerConnectAll(), or some other method for connecting any expected\r
26 boot devices.\r
27\r
28 @retval RETURN_SUCCESS The "bootorder" fw_cfg file has been\r
29 parsed, and the referenced device-subtrees\r
30 have been connected.\r
31\r
32 @retval RETURN_UNSUPPORTED QEMU's fw_cfg is not supported.\r
33\r
34 @retval RETURN_NOT_FOUND Empty or nonexistent "bootorder" fw_cfg\r
35 file.\r
36\r
37 @retval RETURN_INVALID_PARAMETER Parse error in the "bootorder" fw_cfg file.\r
38\r
39 @retval RETURN_OUT_OF_RESOURCES Memory allocation failed.\r
40\r
41 @return Error statuses propagated from underlying\r
42 functions.\r
43**/\r
44RETURN_STATUS\r
45EFIAPI\r
46ConnectDevicesFromQemu (\r
47 VOID\r
48 );\r
49\r
2cd086a6 50/**\r
51\r
52 Set the boot order based on configuration retrieved from QEMU.\r
53\r
54 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the\r
55 OpenFirmware device paths therein to UEFI device path fragments. Match the\r
2542feea
LE
56 translated fragments against the current list of boot options, and rewrite\r
57 the BootOrder NvVar so that it corresponds to the order described in fw_cfg.\r
2cd086a6 58\r
51bd1f76
LE
59 Platform BDS should call this function after connecting any expected boot\r
60 devices and calling EfiBootManagerRefreshAllBootOption ().\r
2cd086a6 61\r
62 @retval RETURN_SUCCESS BootOrder NvVar rewritten.\r
63\r
64 @retval RETURN_UNSUPPORTED QEMU's fw_cfg is not supported.\r
65\r
66 @retval RETURN_NOT_FOUND Empty or nonexistent "bootorder" fw_cfg\r
67 file, or no match found between the\r
68 "bootorder" fw_cfg file and BootOptionList.\r
69\r
70 @retval RETURN_INVALID_PARAMETER Parse error in the "bootorder" fw_cfg file.\r
71\r
72 @retval RETURN_OUT_OF_RESOURCES Memory allocation failed.\r
73\r
74 @return Values returned by gBS->LocateProtocol ()\r
75 or gRT->SetVariable ().\r
76\r
77**/\r
78RETURN_STATUS\r
5851b825 79EFIAPI\r
2cd086a6 80SetBootOrderFromQemu (\r
2542feea 81 VOID\r
2cd086a6 82 );\r
cca7475b 83\r
9253c14d
LE
84/**\r
85 Calculate the number of seconds we should be showing the FrontPage progress\r
86 bar for.\r
87\r
88 @return The TimeoutDefault argument for PlatformBdsEnterFrontPage().\r
89**/\r
90UINT16\r
5851b825 91EFIAPI\r
9253c14d
LE
92GetFrontPageTimeoutFromQemu (\r
93 VOID\r
94 );\r
95\r
cca7475b 96#endif\r