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