]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
Report the setting variable failure to platform through the status code when core...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Bds.h
... / ...
CommitLineData
1/** @file\r
2 Head file for BDS Architectural Protocol implementation\r
3\r
4Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
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 _BDS_MODULE_H_\r
16#define _BDS_MODULE_H_\r
17\r
18#include <FrameworkDxe.h>\r
19#include <IndustryStandard/PeImage.h>\r
20#include <Guid/MdeModuleHii.h>\r
21#include <Guid/FileSystemVolumeLabelInfo.h>\r
22#include <Guid/HiiPlatformSetupFormset.h>\r
23#include <Guid/StatusCodeDataTypeVariable.h>\r
24#include <Protocol/DevicePath.h>\r
25#include <IndustryStandard/SmBios.h>\r
26#include <Protocol/LoadFile.h>\r
27#include <Guid/FileInfo.h>\r
28#include <Protocol/HiiConfigRouting.h>\r
29#include <Protocol/Bds.h>\r
30#include <Protocol/Smbios.h>\r
31#include <Protocol/UgaDraw.h>\r
32#include <Protocol/BlockIo.h>\r
33#include <Guid/GlobalVariable.h>\r
34#include <Guid/CapsuleVendor.h>\r
35#include <Guid/StatusCodeDataTypeId.h>\r
36#include <Guid/LegacyDevOrder.h>\r
37#include <Guid/BdsHii.h>\r
38#include <Guid/ConnectConInEvent.h>\r
39#include <Guid/Performance.h>\r
40#include <Guid/FmpCapsule.h>\r
41#include <Protocol/GenericMemoryTest.h>\r
42#include <Protocol/FormBrowser2.h>\r
43#include <Protocol/HiiConfigAccess.h>\r
44#include <Protocol/GraphicsOutput.h>\r
45#include <Protocol/SimpleFileSystem.h>\r
46#include <Protocol/HiiDatabase.h>\r
47#include <Protocol/HiiString.h>\r
48#include <Protocol/SerialIo.h>\r
49#include <Protocol/LegacyBios.h>\r
50#include <Protocol/SimpleTextInEx.h>\r
51#include <Protocol/DriverHealth.h>\r
52#include <Protocol/BootLogo.h>\r
53#include <Protocol/VariableLock.h>\r
54\r
55#include <Library/UefiDriverEntryPoint.h>\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/PerformanceLib.h>\r
63#include <Library/ReportStatusCodeLib.h>\r
64#include <Library/UefiRuntimeServicesTableLib.h>\r
65#include <Library/HobLib.h>\r
66#include <Library/BaseLib.h>\r
67#include <Library/DevicePathLib.h>\r
68#include <Library/PcdLib.h>\r
69#include <Library/CapsuleLib.h>\r
70#include <Library/HiiLib.h>\r
71#include <Library/DevicePathLib.h>\r
72#include <Library/UefiHiiServicesLib.h>\r
73\r
74#include <Library/GenericBdsLib.h>\r
75#include <Library/PlatformBdsLib.h>\r
76\r
77#pragma pack(1)\r
78\r
79///\r
80/// HII specific Vendor Device Path definition.\r
81///\r
82typedef struct {\r
83 VENDOR_DEVICE_PATH VendorDevicePath;\r
84 EFI_DEVICE_PATH_PROTOCOL End;\r
85} HII_VENDOR_DEVICE_PATH;\r
86\r
87#pragma pack()\r
88\r
89/**\r
90\r
91 Show progress bar with title above it. It only works in Graphics mode.\r
92\r
93 @param TitleForeground Foreground color for Title.\r
94 @param TitleBackground Background color for Title.\r
95 @param Title Title above progress bar.\r
96 @param ProgressColor Progress bar color.\r
97 @param Progress Progress (0-100)\r
98 @param PreviousValue The previous value of the progress.\r
99\r
100 @retval EFI_STATUS Success update the progress bar\r
101\r
102**/\r
103EFI_STATUS\r
104PlatformBdsShowProgress (\r
105 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,\r
106 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,\r
107 IN CHAR16 *Title,\r
108 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,\r
109 IN UINTN Progress,\r
110 IN UINTN PreviousValue\r
111 );\r
112\r
113//\r
114// Prototypes\r
115//\r
116\r
117/**\r
118\r
119 Install Boot Device Selection Protocol\r
120\r
121 @param ImageHandle The image handle.\r
122 @param SystemTable The system table.\r
123\r
124 @retval EFI_SUCEESS BDS has finished initializing.\r
125 Return the dispatcher and recall BDS.Entry\r
126 @retval Other Return status from AllocatePool() or gBS->InstallProtocolInterface\r
127\r
128**/\r
129EFI_STATUS\r
130EFIAPI\r
131BdsInitialize (\r
132 IN EFI_HANDLE ImageHandle,\r
133 IN EFI_SYSTEM_TABLE *SystemTable\r
134 );\r
135\r
136/**\r
137\r
138 Service routine for BdsInstance->Entry(). Devices are connected, the\r
139 consoles are initialized, and the boot options are tried.\r
140\r
141 @param This Protocol Instance structure.\r
142\r
143**/\r
144VOID\r
145EFIAPI\r
146BdsEntry (\r
147 IN EFI_BDS_ARCH_PROTOCOL *This\r
148 );\r
149\r
150\r
151/**\r
152 Perform the memory test base on the memory test intensive level,\r
153 and update the memory resource.\r
154\r
155 @param Level The memory test intensive level.\r
156\r
157 @retval EFI_STATUS Success test all the system memory and update\r
158 the memory resource\r
159\r
160**/\r
161EFI_STATUS\r
162EFIAPI\r
163BdsMemoryTest (\r
164 IN EXTENDMEM_COVERAGE_LEVEL Level\r
165 );\r
166\r
167/**\r
168\r
169 This routine is called to see if there are any capsules we need to process.\r
170 If the boot mode is not UPDATE, then we do nothing. Otherwise find the\r
171 capsule HOBS and produce firmware volumes for them via the DXE service.\r
172 Then call the dispatcher to dispatch drivers from them. Finally, check\r
173 the status of the updates.\r
174\r
175 This function should be called by BDS in case we need to do some\r
176 sort of processing even if there is no capsule to process. We\r
177 need to do this if an earlier update went away and we need to\r
178 clear the capsule variable so on the next reset PEI does not see it and\r
179 think there is a capsule available.\r
180\r
181 @param BootMode the current boot mode\r
182\r
183 @retval EFI_INVALID_PARAMETER boot mode is not correct for an update\r
184 @retval EFI_SUCCESS There is no error when processing capsule\r
185\r
186**/\r
187EFI_STATUS\r
188EFIAPI\r
189BdsProcessCapsules (\r
190 EFI_BOOT_MODE BootMode\r
191 );\r
192\r
193/**\r
194 Set the variable and report the error through status code upon failure.\r
195\r
196 @param VariableName A Null-terminated string that is the name of the vendor's variable.\r
197 Each VariableName is unique for each VendorGuid. VariableName must\r
198 contain 1 or more characters. If VariableName is an empty string,\r
199 then EFI_INVALID_PARAMETER is returned.\r
200 @param VendorGuid A unique identifier for the vendor.\r
201 @param Attributes Attributes bitmask to set for the variable.\r
202 @param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, \r
203 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or \r
204 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero \r
205 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is \r
206 set, then a SetVariable() call with a DataSize of zero will not cause any change to \r
207 the variable value (the timestamp associated with the variable may be updated however \r
208 even if no new data value is provided,see the description of the \r
209 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not \r
210 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). \r
211 @param Data The contents for the variable.\r
212\r
213 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r
214 defined by the Attributes.\r
215 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the\r
216 DataSize exceeds the maximum allowed.\r
217 @retval EFI_INVALID_PARAMETER VariableName is an empty string.\r
218 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
219 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
220 @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r
221 @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r
222 @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS \r
223 or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo \r
224 does NOT pass the validation check carried out by the firmware.\r
225\r
226 @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r
227**/\r
228EFI_STATUS\r
229BdsDxeSetVariableAndReportStatusCodeOnError (\r
230 IN CHAR16 *VariableName,\r
231 IN EFI_GUID *VendorGuid,\r
232 IN UINT32 Attributes,\r
233 IN UINTN DataSize,\r
234 IN VOID *Data\r
235 );\r
236\r
237#endif\r