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