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