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