]> code.delx.au - refind/blob - EfiLib/legacy.h
New CSM/BIOS/legacy support code for UEFI PCs.
[refind] / EfiLib / legacy.h
1 /*
2 * EfiLib/legacy.h
3 * CSM/legacy boot support functions
4 *
5 * Taken from Tianocore source code (mostly IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c)
6 *
7 * Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
8 * This program and the accompanying materials
9 * are licensed and made available under the terms and conditions of the BSD License
10 * which accompanies this distribution. The full text of the license may be found at
11 * http://opensource.org/licenses/bsd-license.php
12 *
13 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 *
16 */
17
18 #ifndef __LEGACY_H_
19 #define __LEGACY_H_
20
21 #define VAR_FLAG EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE
22
23 #pragma pack(1)
24 ///
25 /// For each legacy boot option in BBS table, a corresponding Boot#### variables is created.
26 /// The structure saves the mapping relationship between #### and the index in the BBS table.
27 ///
28 typedef struct {
29 UINT16 BootOptionNumber;
30 UINT16 BbsIndex;
31 UINT16 BbsType;
32 } BOOT_OPTION_BBS_MAPPING;
33 #pragma pack()
34
35 EFI_STATUS
36 EFIAPI
37 BdsAddNonExistingLegacyBootOptions (
38 VOID
39 );
40
41 /**
42 Delete all the invalid legacy boot options.
43
44 @retval EFI_SUCCESS All invalide legacy boot options are deleted.
45 @retval EFI_OUT_OF_RESOURCES Fail to allocate necessary memory.
46 @retval EFI_NOT_FOUND Fail to retrive variable of boot order.
47 **/
48 EFI_STATUS
49 EFIAPI
50 BdsDeleteAllInvalidLegacyBootOptions (
51 VOID
52 );
53
54 /**
55 Add the legacy boot devices from BBS table into
56 the legacy device boot order.
57
58 @retval EFI_SUCCESS The boot devices are added successfully.
59 @retval EFI_NOT_FOUND The legacy boot devices are not found.
60 @retval EFI_OUT_OF_RESOURCES Memmory or storage is not enough.
61 @retval EFI_DEVICE_ERROR Fail to add the legacy device boot order into EFI variable
62 because of hardware error.
63 **/
64 // EFI_STATUS
65 // EFIAPI
66 // BdsUpdateLegacyDevOrder (
67 // VOID
68 // );
69
70 #endif