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 SetBootOrderFromQemu ( 53 VOID 54 ); 55 56 57 /** 58 Calculate the number of seconds we should be showing the FrontPage progress 59 bar for. 60 61 @return The TimeoutDefault argument for PlatformBdsEnterFrontPage(). 62 **/ 63 UINT16 64 GetFrontPageTimeoutFromQemu ( 65 VOID 66 ); 67 68 #endif 69