]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.h
ArmVirtualizationPkg: PlatformIntelBdsLib: add basic policy
[mirror_edk2.git] / OvmfPkg / Library / PlatformBdsLib / QemuBootOrder.h
1 /** @file
2 Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file --
3 include file.
4
5 Copyright (C) 2012, Red Hat, Inc.
6
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 **/
15
16
17 #include <Uefi/UefiBaseType.h>
18 #include <Base.h>
19
20
21 /**
22
23 Set the boot order based on configuration retrieved from QEMU.
24
25 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the
26 OpenFirmware device paths therein to UEFI device path fragments. Match the
27 translated fragments against BootOptionList, and rewrite the BootOrder NvVar
28 so that it corresponds to the order described in fw_cfg.
29
30 @param[in] BootOptionList A boot option list, created with
31 BdsLibEnumerateAllBootOption ().
32
33
34 @retval RETURN_SUCCESS BootOrder NvVar rewritten.
35
36 @retval RETURN_UNSUPPORTED QEMU's fw_cfg is not supported.
37
38 @retval RETURN_NOT_FOUND Empty or nonexistent "bootorder" fw_cfg
39 file, or no match found between the
40 "bootorder" fw_cfg file and BootOptionList.
41
42 @retval RETURN_INVALID_PARAMETER Parse error in the "bootorder" fw_cfg file.
43
44 @retval RETURN_OUT_OF_RESOURCES Memory allocation failed.
45
46 @return Values returned by gBS->LocateProtocol ()
47 or gRT->SetVariable ().
48
49 **/
50 RETURN_STATUS
51 SetBootOrderFromQemu (
52 IN CONST LIST_ENTRY *BootOptionList
53 );