]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
Add new interface GetVariable2 and GetEfiGlobalVariable2 to return more info. Also...
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / InternalBdsLib.h
CommitLineData
5c08e117 1/** @file\r
2 BDS library definition, include the file and data structure\r
3\r
2df686c6 4Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
180a5a35 5This program and the accompanying materials\r
5c08e117 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _INTERNAL_BDS_LIB_H_\r
16#define _INTERNAL_BDS_LIB_H_\r
17\r
79bc7a89 18#include <FrameworkDxe.h>\r
5c08e117 19\r
2828833e 20#include <IndustryStandard/Pci.h>\r
67d63227 21#include <IndustryStandard/PeImage.h>\r
5c08e117 22\r
23#include <Protocol/BlockIo.h>\r
24#include <Protocol/LoadedImage.h>\r
25#include <Protocol/Cpu.h>\r
26#include <Protocol/SimpleFileSystem.h>\r
ff482c56 27#include <Protocol/LoadFile.h>\r
5c08e117 28#include <Protocol/DebugPort.h>\r
29#include <Protocol/DevicePath.h>\r
30#include <Protocol/SimpleTextIn.h>\r
31#include <Protocol/LegacyBios.h>\r
32#include <Protocol/SimpleTextOut.h>\r
33#include <Protocol/SimpleNetwork.h>\r
34#include <Protocol/DevicePathToText.h>\r
35#include <Protocol/FirmwareVolume2.h>\r
36#include <Protocol/PciIo.h>\r
37#include <Protocol/AcpiS3Save.h>\r
5c08e117 38#include <Protocol/OEMBadging.h>\r
5c08e117 39#include <Protocol/GraphicsOutput.h>\r
40#include <Protocol/UgaDraw.h>\r
41#include <Protocol/HiiFont.h>\r
42#include <Protocol/HiiImage.h>\r
7389fdd0 43#include <Protocol/UsbIo.h>\r
2df686c6 44#include <Protocol/BootLogo.h>\r
5c08e117 45\r
5c08e117 46#include <Guid/MemoryTypeInformation.h>\r
47#include <Guid/FileInfo.h>\r
48#include <Guid/GlobalVariable.h>\r
49#include <Guid/PcAnsi.h>\r
6055758f 50#include <Guid/Performance.h>\r
e24fc103
LG
51#include <Guid/BdsLibHii.h>\r
52#include <Guid/HdBootVariable.h>\r
53#include <Guid/LastEnumLang.h>\r
5c08e117 54\r
55#include <Library/PrintLib.h>\r
56#include <Library/DebugLib.h>\r
57#include <Library/BaseMemoryLib.h>\r
58#include <Library/UefiBootServicesTableLib.h>\r
59#include <Library/UefiLib.h>\r
60#include <Library/MemoryAllocationLib.h>\r
61#include <Library/DxeServicesTableLib.h>\r
62#include <Library/UefiRuntimeServicesTableLib.h>\r
63#include <Library/HobLib.h>\r
64#include <Library/BaseLib.h>\r
65#include <Library/DevicePathLib.h>\r
66#include <Library/PerformanceLib.h>\r
67#include <Library/PcdLib.h>\r
5c08e117 68#include <Library/PeCoffGetEntryPointLib.h>\r
69#include <Library/GenericBdsLib.h>\r
70#include <Library/TimerLib.h>\r
71#include <Library/PcdLib.h>\r
72#include <Library/DxeServicesLib.h>\r
79b7a6a1 73#include <Library/ReportStatusCodeLib.h>\r
5c08e117 74\r
a95f236b 75#if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)\r
76 #if defined (MDE_CPU_EBC)\r
77 //\r
78 // Uefi specification only defines the default boot file name for IA32, X64\r
79 // and IPF processor, so need define boot file name for EBC architecture here.\r
80 //\r
81 #define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
82 #else\r
83 #error "Can not determine the default boot file name for unknown processor type!"\r
84 #endif\r
85#endif\r
5c08e117 86\r
87/**\r
88\r
89 Allocates a block of memory and writes performance data of booting into it.\r
90 OS can processing these record.\r
91 \r
92**/\r
93VOID\r
94WriteBootToOsPerformanceData (\r
95 VOID\r
96 );\r
97\r
67d63227
LG
98/**\r
99 Get the headers (dos, image, optional header) from an image\r
100\r
101 @param Device SimpleFileSystem device handle\r
102 @param FileName File name for the image\r
103 @param DosHeader Pointer to dos header\r
104 @param Hdr The buffer in which to return the PE32, PE32+, or TE header.\r
105\r
106 @retval EFI_SUCCESS Successfully get the machine type.\r
107 @retval EFI_NOT_FOUND The file is not found.\r
108 @retval EFI_LOAD_ERROR File is not a valid image file.\r
109\r
110**/\r
111EFI_STATUS\r
112EFIAPI\r
113BdsLibGetImageHeader (\r
114 IN EFI_HANDLE Device,\r
115 IN CHAR16 *FileName,\r
116 OUT EFI_IMAGE_DOS_HEADER *DosHeader,\r
117 OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr\r
118 );\r
119\r
7caf72a9
RN
120/**\r
121 This routine adjust the memory information for different memory type and \r
122 save them into the variables for next boot.\r
123**/\r
124VOID\r
125BdsSetMemoryTypeInformationVariable (\r
126 VOID\r
127 );\r
128\r
8c08a567
ED
129/**\r
130 Validate the EFI Boot#### or Driver#### variable (VendorGuid/Name)\r
131\r
132 @param Variable Boot#### variable data.\r
133 @param VariableSize Returns the size of the EFI variable that was read\r
134\r
135 @retval TRUE The variable data is correct.\r
136 @retval FALSE The variable data is corrupted.\r
137\r
138**/\r
139BOOLEAN \r
140ValidateOption (\r
141 UINT8 *Variable,\r
142 UINTN VariableSize\r
143 );\r
144\r
5c08e117 145#endif // _BDS_LIB_H_\r