]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - OvmfPkg/Include/Library/QemuBootOrderLib.h
OvmfPkg/QemuBootOrderLib: add StoreQemuBootOrder()
[mirror_edk2.git] / OvmfPkg / Include / Library / QemuBootOrderLib.h
... / ...
CommitLineData
1/** @file\r
2 Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file --\r
3 include file.\r
4\r
5 Copyright (C) 2012-2014, Red Hat, Inc.\r
6\r
7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
8**/\r
9\r
10#ifndef __QEMU_BOOT_ORDER_LIB_H__\r
11#define __QEMU_BOOT_ORDER_LIB_H__\r
12\r
13#include <Uefi/UefiBaseType.h>\r
14#include <Base.h>\r
15\r
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
50/**\r
51 Write qemu boot order to uefi variables.\r
52\r
53 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate\r
54 the OpenFirmware device paths therein to UEFI device path fragments.\r
55\r
56 On Success store the device path in QemuBootOrderNNNN variables.\r
57**/\r
58VOID\r
59EFIAPI\r
60StoreQemuBootOrder (\r
61 VOID\r
62 );\r
63\r
64/**\r
65\r
66 Set the boot order based on configuration retrieved from QEMU.\r
67\r
68 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the\r
69 OpenFirmware device paths therein to UEFI device path fragments. Match the\r
70 translated fragments against the current list of boot options, and rewrite\r
71 the BootOrder NvVar so that it corresponds to the order described in fw_cfg.\r
72\r
73 Platform BDS should call this function after connecting any expected boot\r
74 devices and calling EfiBootManagerRefreshAllBootOption ().\r
75\r
76 @retval RETURN_SUCCESS BootOrder NvVar rewritten.\r
77\r
78 @retval RETURN_UNSUPPORTED QEMU's fw_cfg is not supported.\r
79\r
80 @retval RETURN_NOT_FOUND Empty or nonexistent "bootorder" fw_cfg\r
81 file, or no match found between the\r
82 "bootorder" fw_cfg file and BootOptionList.\r
83\r
84 @retval RETURN_INVALID_PARAMETER Parse error in the "bootorder" fw_cfg file.\r
85\r
86 @retval RETURN_OUT_OF_RESOURCES Memory allocation failed.\r
87\r
88 @return Values returned by gBS->LocateProtocol ()\r
89 or gRT->SetVariable ().\r
90\r
91**/\r
92RETURN_STATUS\r
93EFIAPI\r
94SetBootOrderFromQemu (\r
95 VOID\r
96 );\r
97\r
98/**\r
99 Calculate the number of seconds we should be showing the FrontPage progress\r
100 bar for.\r
101\r
102 @return The TimeoutDefault argument for PlatformBdsEnterFrontPage().\r
103**/\r
104UINT16\r
105EFIAPI\r
106GetFrontPageTimeoutFromQemu (\r
107 VOID\r
108 );\r
109\r
110#endif\r