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