]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
Vlv2TbltDevicePkg/Override/GenericBdsLib: Use BmpSupportLib
[mirror_edk2.git] / Vlv2TbltDevicePkg / Override / IntelFrameworkModulePkg / Library / GenericBdsLib / InternalBdsLib.h
CommitLineData
3cbfba02
DW
1/** @file\r
2 BDS library definition, include the file and data structure\r
3\r
080851ae 4Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
3cbfba02
DW
5This program and the accompanying materials\r
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
18#include <FrameworkDxe.h>\r
19\r
20#include <IndustryStandard/Pci.h>\r
21#include <IndustryStandard/PeImage.h>\r
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
27#include <Protocol/LoadFile.h>\r
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/FirmwareVolume2.h>\r
35#include <Protocol/PciIo.h>\r
36#include <Protocol/AcpiS3Save.h>\r
37#include <Protocol/OEMBadging.h>\r
38#include <Protocol/GraphicsOutput.h>\r
39#include <Protocol/UgaDraw.h>\r
40#include <Protocol/HiiFont.h>\r
41#include <Protocol/HiiImage.h>\r
42#include <Protocol/UsbIo.h>\r
43#include <Protocol/BootLogo.h>\r
44\r
45#include <Guid/MemoryTypeInformation.h>\r
46#include <Guid/FileInfo.h>\r
47#include <Guid/GlobalVariable.h>\r
48#include <Guid/PcAnsi.h>\r
49#include <Guid/Performance.h>\r
50#include <Guid/BdsLibHii.h>\r
51#include <Guid/HdBootVariable.h>\r
52#include <Guid/LastEnumLang.h>\r
53#include <Guid/LegacyDevOrder.h>\r
217abb46 54#include <Guid/StatusCodeDataTypeVariable.h>\r
3cbfba02
DW
55\r
56#include <Library/PrintLib.h>\r
57#include <Library/DebugLib.h>\r
58#include <Library/BaseMemoryLib.h>\r
59#include <Library/UefiBootServicesTableLib.h>\r
60#include <Library/UefiLib.h>\r
61#include <Library/MemoryAllocationLib.h>\r
62#include <Library/DxeServicesTableLib.h>\r
63#include <Library/UefiRuntimeServicesTableLib.h>\r
64#include <Library/HobLib.h>\r
65#include <Library/BaseLib.h>\r
66#include <Library/DevicePathLib.h>\r
67#include <Library/PerformanceLib.h>\r
68#include <Library/PcdLib.h>\r
69#include <Library/PeCoffGetEntryPointLib.h>\r
70#include <Library/GenericBdsLib.h>\r
71#include <Library/TimerLib.h>\r
72#include <Library/PcdLib.h>\r
73#include <Library/DxeServicesLib.h>\r
74#include <Library/ReportStatusCodeLib.h>\r
080851ae 75#include <Library/BmpSupportLib.h>\r
3cbfba02
DW
76\r
77#if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)\r
78 #if defined (MDE_CPU_EBC)\r
79 //\r
80 // Uefi specification only defines the default boot file name for IA32, X64\r
81 // and IPF processor, so need define boot file name for EBC architecture here.\r
82 //\r
83 #define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
84 #else\r
85 #error "Can not determine the default boot file name for unknown processor type!"\r
86 #endif\r
87#endif\r
88\r
89/**\r
90\r
91 Writes performance data of booting into the allocated memory.\r
92 OS can process these records.\r
93\r
94 @param Event The triggered event.\r
95 @param Context Context for this event.\r
96\r
97**/\r
98VOID\r
99EFIAPI\r
100WriteBootToOsPerformanceData (\r
101 IN EFI_EVENT Event,\r
102 IN VOID *Context\r
103 );\r
104\r
105/**\r
106 Get the headers (dos, image, optional header) from an image\r
107\r
108 @param Device SimpleFileSystem device handle\r
109 @param FileName File name for the image\r
110 @param DosHeader Pointer to dos header\r
111 @param Hdr The buffer in which to return the PE32, PE32+, or TE header.\r
112\r
113 @retval EFI_SUCCESS Successfully get the machine type.\r
114 @retval EFI_NOT_FOUND The file is not found.\r
115 @retval EFI_LOAD_ERROR File is not a valid image file.\r
116\r
117**/\r
118EFI_STATUS\r
119EFIAPI\r
120BdsLibGetImageHeader (\r
121 IN EFI_HANDLE Device,\r
122 IN CHAR16 *FileName,\r
123 OUT EFI_IMAGE_DOS_HEADER *DosHeader,\r
124 OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr\r
125 );\r
126\r
127/**\r
128 This routine adjust the memory information for different memory type and \r
129 save them into the variables for next boot.\r
130**/\r
131VOID\r
132BdsSetMemoryTypeInformationVariable (\r
133 VOID\r
134 );\r
135\r
136/**\r
137 Validate the EFI Boot#### or Driver#### variable (VendorGuid/Name)\r
138\r
139 @param Variable Boot#### variable data.\r
140 @param VariableSize Returns the size of the EFI variable that was read\r
141\r
142 @retval TRUE The variable data is correct.\r
143 @retval FALSE The variable data is corrupted.\r
144\r
145**/\r
146BOOLEAN \r
147ValidateOption (\r
148 UINT8 *Variable,\r
149 UINTN VariableSize\r
150 );\r
151\r
217abb46
SL
152/**\r
153 Set the variable and report the error through status code upon failure.\r
154\r
155 @param VariableName A Null-terminated string that is the name of the vendor's variable.\r
156 Each VariableName is unique for each VendorGuid. VariableName must\r
157 contain 1 or more characters. If VariableName is an empty string,\r
158 then EFI_INVALID_PARAMETER is returned.\r
159 @param VendorGuid A unique identifier for the vendor.\r
160 @param Attributes Attributes bitmask to set for the variable.\r
161 @param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, \r
162 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or \r
163 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero \r
164 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is \r
165 set, then a SetVariable() call with a DataSize of zero will not cause any change to \r
166 the variable value (the timestamp associated with the variable may be updated however \r
167 even if no new data value is provided,see the description of the \r
168 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not \r
169 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). \r
170 @param Data The contents for the variable.\r
171\r
172 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r
173 defined by the Attributes.\r
174 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the\r
175 DataSize exceeds the maximum allowed.\r
176 @retval EFI_INVALID_PARAMETER VariableName is an empty string.\r
177 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
178 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
179 @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r
180 @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r
181 @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS \r
182 or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo \r
183 does NOT pass the validation check carried out by the firmware.\r
184\r
185 @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r
186**/\r
187EFI_STATUS\r
188SetVariableAndReportStatusCodeOnError (\r
189 IN CHAR16 *VariableName,\r
190 IN EFI_GUID *VendorGuid,\r
191 IN UINT32 Attributes,\r
192 IN UINTN DataSize,\r
193 IN VOID *Data\r
194 );\r
195\r
3cbfba02 196#endif // _BDS_LIB_H_\r