]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ShellPkg / Library / UefiHandleParsingLib / UefiHandleParsingLib.h
1 /** @file
2 Provides interface to advanced shell functionality for parsing both handle and protocol database.
3
4 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
6 (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
12 #define _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
13
14 #include <Uefi.h>
15
16 #include <Guid/FileInfo.h>
17 #include <Guid/ConsoleInDevice.h>
18 #include <Guid/ConsoleOutDevice.h>
19 #include <Guid/StandardErrorDevice.h>
20 #include <Guid/GlobalVariable.h>
21 #include <Guid/Gpt.h>
22 #include <Guid/FileSystemInfo.h>
23 #include <Guid/ShellLibHiiGuid.h>
24
25 #include <Protocol/SimpleFileSystem.h>
26 #include <Protocol/LoadedImage.h>
27 #include <Protocol/EfiShellInterface.h>
28 #include <Protocol/EfiShellEnvironment2.h>
29 #include <Protocol/Shell.h>
30 #include <Protocol/ShellParameters.h>
31 #include <Protocol/DevicePathToText.h>
32 #include <Protocol/DriverBinding.h>
33 #include <Protocol/DriverConfiguration2.h>
34 #include <Protocol/DriverConfiguration.h>
35 #include <Protocol/DriverDiagnostics2.h>
36 #include <Protocol/DriverDiagnostics.h>
37 #include <Protocol/ComponentName2.h>
38 #include <Protocol/ComponentName.h>
39 #include <Protocol/PlatformDriverOverride.h>
40 #include <Protocol/DevicePathUtilities.h>
41 #include <Protocol/DevicePathFromText.h>
42 #include <Protocol/BusSpecificDriverOverride.h>
43 #include <Protocol/PlatformToDriverConfiguration.h>
44 #include <Protocol/DriverSupportedEfiVersion.h>
45 #include <Protocol/SimpleTextInEx.h>
46 #include <Protocol/SimplePointer.h>
47 #include <Protocol/SerialIo.h>
48 #include <Protocol/AbsolutePointer.h>
49 #include <Protocol/GraphicsOutput.h>
50 #include <Protocol/EdidDiscovered.h>
51 #include <Protocol/EdidActive.h>
52 #include <Protocol/EdidOverride.h>
53 #include <Protocol/LoadFile.h>
54 #include <Protocol/LoadFile2.h>
55 #include <Protocol/TapeIo.h>
56 #include <Protocol/DiskIo.h>
57 #include <Protocol/BlockIo.h>
58 #include <Protocol/UnicodeCollation.h>
59 #include <Protocol/PciRootBridgeIo.h>
60 #include <Protocol/PciIo.h>
61 #include <Protocol/ScsiPassThru.h>
62 #include <Protocol/ScsiPassThruExt.h>
63 #include <Protocol/ScsiIo.h>
64 #include <Protocol/IScsiInitiatorName.h>
65 #include <Protocol/UsbIo.h>
66 #include <Protocol/UsbHostController.h>
67 #include <Protocol/Usb2HostController.h>
68 #include <Protocol/DebugSupport.h>
69 #include <Protocol/DebugPort.h>
70 #include <Protocol/Decompress.h>
71 #include <Protocol/AcpiTable.h>
72 #include <Protocol/Ebc.h>
73 #include <Protocol/SimpleNetwork.h>
74 #include <Protocol/NetworkInterfaceIdentifier.h>
75 #include <Protocol/PxeBaseCode.h>
76 #include <Protocol/PxeBaseCodeCallBack.h>
77 #include <Protocol/Bis.h>
78 #include <Protocol/ManagedNetwork.h>
79 #include <Protocol/Arp.h>
80 #include <Protocol/Dhcp4.h>
81 #include <Protocol/Tcp4.h>
82 #include <Protocol/Ip4.h>
83 #include <Protocol/Ip4Config.h>
84 #include <Protocol/Ip4Config2.h>
85 #include <Protocol/Udp4.h>
86 #include <Protocol/Mtftp4.h>
87 #include <Protocol/AuthenticationInfo.h>
88 #include <Protocol/Hash.h>
89 #include <Protocol/HiiFont.h>
90 #include <Protocol/HiiString.h>
91 #include <Protocol/HiiImage.h>
92 #include <Protocol/HiiDatabase.h>
93 #include <Protocol/HiiConfigRouting.h>
94 #include <Protocol/HiiConfigAccess.h>
95 #include <Protocol/FormBrowser2.h>
96 #include <Protocol/DeviceIo.h>
97 #include <Protocol/UgaDraw.h>
98 #include <Protocol/UgaIo.h>
99 #include <Protocol/DriverConfiguration.h>
100 #include <Protocol/DriverConfiguration2.h>
101 #include <Protocol/DevicePathUtilities.h>
102 // #include <Protocol/FirmwareVolume.h>
103 // #include <Protocol/FirmwareVolume2.h>
104 #include <Protocol/DriverFamilyOverride.h>
105 #include <Protocol/Pcd.h>
106 #include <Protocol/TcgService.h>
107 #include <Protocol/HiiPackageList.h>
108 #include <Protocol/Ip6.h>
109 #include <Protocol/Ip6Config.h>
110 #include <Protocol/Mtftp6.h>
111 #include <Protocol/Dhcp6.h>
112 #include <Protocol/Udp6.h>
113 #include <Protocol/Tcp6.h>
114 #include <Protocol/VlanConfig.h>
115 #include <Protocol/Eap.h>
116 #include <Protocol/EapManagement.h>
117 #include <Protocol/Ftp4.h>
118 #include <Protocol/IpSecConfig.h>
119 #include <Protocol/DriverHealth.h>
120 #include <Protocol/DeferredImageLoad.h>
121 #include <Protocol/UserCredential.h>
122 #include <Protocol/UserManager.h>
123 #include <Protocol/AtaPassThru.h>
124 #include <Protocol/FirmwareManagement.h>
125 #include <Protocol/IpSec.h>
126 #include <Protocol/Kms.h>
127 #include <Protocol/BlockIo2.h>
128 #include <Protocol/StorageSecurityCommand.h>
129 #include <Protocol/UserCredential2.h>
130 #include <Protocol/IdeControllerInit.h>
131 #include <Protocol/DiskIo2.h>
132 #include <Protocol/AdapterInformation.h>
133 #include <Protocol/ShellDynamicCommand.h>
134 #include <Protocol/DiskInfo.h>
135 #include <Protocol/PartitionInfo.h>
136
137 #include <Library/HandleParsingLib.h>
138 #include <Library/UefiBootServicesTableLib.h>
139 #include <Library/BaseLib.h>
140 #include <Library/BaseMemoryLib.h>
141 #include <Library/DebugLib.h>
142 #include <Library/MemoryAllocationLib.h>
143 #include <Library/DevicePathLib.h>
144 #include <Library/PcdLib.h>
145 #include <Library/PrintLib.h>
146 #include <Library/UefiLib.h>
147 #include <Library/HiiLib.h>
148 #include <Library/ShellLib.h>
149 #include <Library/SortLib.h>
150 #include <Library/ShellCommandLib.h>
151 #include <Library/PeCoffGetEntryPointLib.h>
152
153 #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1 1
154 #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2 2
155
156 ///
157 /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a
158 ///
159 typedef struct {
160 ///
161 /// A unique number identifying the firmware image within the device. The number is
162 /// between 1 and DescriptorCount.
163 ///
164 UINT8 ImageIndex;
165 ///
166 /// A unique number identifying the firmware image type.
167 ///
168 EFI_GUID ImageTypeId;
169 ///
170 /// A unique number identifying the firmware image.
171 ///
172 UINT64 ImageId;
173 ///
174 /// A pointer to a null-terminated string representing the firmware image name.
175 ///
176 CHAR16 *ImageIdName;
177 ///
178 /// Identifies the version of the device firmware. The format is vendor specific and new
179 /// version must have a greater value than an old version.
180 ///
181 UINT32 Version;
182 ///
183 /// A pointer to a null-terminated string representing the firmware image version name.
184 ///
185 CHAR16 *VersionName;
186 ///
187 /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
188 ///
189 UINTN Size;
190 ///
191 /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
192 /// for possible returned values of this parameter. A value of 1 indicates the attribute is
193 /// supported and the current setting value is indicated in AttributesSetting. A
194 /// value of 0 indicates the attribute is not supported and the current setting value in
195 /// AttributesSetting is meaningless.
196 ///
197 UINT64 AttributesSupported;
198 ///
199 /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
200 /// this parameter.
201 ///
202 UINT64 AttributesSetting;
203 ///
204 /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
205 /// values of this parameter.
206 ///
207 UINT64 Compatibilities;
208 } EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1;
209
210 ///
211 /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5
212 ///
213 typedef struct {
214 ///
215 /// A unique number identifying the firmware image within the device. The number is
216 /// between 1 and DescriptorCount.
217 ///
218 UINT8 ImageIndex;
219 ///
220 /// A unique number identifying the firmware image type.
221 ///
222 EFI_GUID ImageTypeId;
223 ///
224 /// A unique number identifying the firmware image.
225 ///
226 UINT64 ImageId;
227 ///
228 /// A pointer to a null-terminated string representing the firmware image name.
229 ///
230 CHAR16 *ImageIdName;
231 ///
232 /// Identifies the version of the device firmware. The format is vendor specific and new
233 /// version must have a greater value than an old version.
234 ///
235 UINT32 Version;
236 ///
237 /// A pointer to a null-terminated string representing the firmware image version name.
238 ///
239 CHAR16 *VersionName;
240 ///
241 /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
242 ///
243 UINTN Size;
244 ///
245 /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
246 /// for possible returned values of this parameter. A value of 1 indicates the attribute is
247 /// supported and the current setting value is indicated in AttributesSetting. A
248 /// value of 0 indicates the attribute is not supported and the current setting value in
249 /// AttributesSetting is meaningless.
250 ///
251 UINT64 AttributesSupported;
252 ///
253 /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
254 /// this parameter.
255 ///
256 UINT64 AttributesSetting;
257 ///
258 /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
259 /// values of this parameter.
260 ///
261 UINT64 Compatibilities;
262 ///
263 /// Describes the lowest ImageDescriptor version that the device will accept. Only
264 /// present in version 2 or higher.
265 UINT32 LowestSupportedImageVersion;
266 } EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2;
267
268 typedef struct {
269 LIST_ENTRY Link;
270 EFI_HANDLE TheHandle;
271 UINTN TheIndex;
272 } HANDLE_LIST;
273
274 typedef struct {
275 HANDLE_LIST List;
276 UINTN NextIndex;
277 } HANDLE_INDEX_LIST;
278
279 typedef
280 CHAR16 *
281 (EFIAPI *DUMP_PROTOCOL_INFO)(
282 IN CONST EFI_HANDLE TheHandle,
283 IN CONST BOOLEAN Verbose
284 );
285
286 typedef struct _GUID_INFO_BLOCK {
287 EFI_STRING_ID StringId;
288 EFI_GUID *GuidId;
289 DUMP_PROTOCOL_INFO DumpInfo;
290 } GUID_INFO_BLOCK;
291
292 #endif