874344a95d80258e6f1d4a07e0a67fd81f9cdb7c
[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 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 #ifndef __QEMU_BOOT_ORDER_LIB_H__
17 #define __QEMU_BOOT_ORDER_LIB_H__
18
19 #include <Uefi/UefiBaseType.h>
20 #include <Base.h>
21
22
23 /**
24
25 Set the boot order based on configuration retrieved from QEMU.
26
27 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the
28 OpenFirmware device paths therein to UEFI device path fragments. Match the
29 translated fragments against the current list of boot options, and rewrite
30 the BootOrder NvVar so that it corresponds to the order described in fw_cfg.
31
32 Platform BDS should call this function after EfiBootManagerConnectAll () and
33 EfiBootManagerRefreshAllBootOption () return.
34
35 @retval RETURN_SUCCESS BootOrder NvVar rewritten.
36
37 @retval RETURN_UNSUPPORTED QEMU's fw_cfg is not supported.
38
39 @retval RETURN_NOT_FOUND Empty or nonexistent "bootorder" fw_cfg
40 file, or no match found between the
41 "bootorder" fw_cfg file and BootOptionList.
42
43 @retval RETURN_INVALID_PARAMETER Parse error in the "bootorder" fw_cfg file.
44
45 @retval RETURN_OUT_OF_RESOURCES Memory allocation failed.
46
47 @return Values returned by gBS->LocateProtocol ()
48 or gRT->SetVariable ().
49
50 **/
51 RETURN_STATUS
52 EFIAPI
53 SetBootOrderFromQemu (
54 VOID
55 );
56
57
58 /**
59 Calculate the number of seconds we should be showing the FrontPage progress
60 bar for.
61
62 @return The TimeoutDefault argument for PlatformBdsEnterFrontPage().
63 **/
64 UINT16
65 EFIAPI
66 GetFrontPageTimeoutFromQemu (
67 VOID
68 );
69
70 #endif