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