• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 BootOptionList, and rewrite the BootOrder NvVar
30   so that it corresponds to the order described in fw_cfg.
31 
32   @param[in] BootOptionList  A boot option list, created with
33                              BdsLibEnumerateAllBootOption ().
34 
35 
36   @retval RETURN_SUCCESS            BootOrder NvVar rewritten.
37 
38   @retval RETURN_UNSUPPORTED        QEMU's fw_cfg is not supported.
39 
40   @retval RETURN_NOT_FOUND          Empty or nonexistent "bootorder" fw_cfg
41                                     file, or no match found between the
42                                     "bootorder" fw_cfg file and BootOptionList.
43 
44   @retval RETURN_INVALID_PARAMETER  Parse error in the "bootorder" fw_cfg file.
45 
46   @retval RETURN_OUT_OF_RESOURCES   Memory allocation failed.
47 
48   @return                           Values returned by gBS->LocateProtocol ()
49                                     or gRT->SetVariable ().
50 
51 **/
52 RETURN_STATUS
53 SetBootOrderFromQemu (
54   IN  CONST LIST_ENTRY *BootOptionList
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 GetFrontPageTimeoutFromQemu (
66   VOID
67   );
68 
69 #endif
70