]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
ShellPkg/pci: Fix extended register dumping for MFVC capability
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / UefiShellDebug1CommandsLib.h
CommitLineData
5d73d92f 1/** @file\r
2 Main file for NULL named library for Profile1 shell command functions.\r
3\r
28165f24 4 Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
5d73d92f 5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
a1d4bfcc 15#ifndef _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_\r
3737ac2b 16#define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_\r
17\r
5d73d92f 18#include <Uefi.h>\r
5d73d92f 19\r
20#include <Guid/GlobalVariable.h>\r
21#include <Guid/ConsoleInDevice.h>\r
22#include <Guid/ConsoleOutDevice.h>\r
3737ac2b 23#include <Guid/FileSystemInfo.h>\r
bca163ff 24#include <Guid/ShellLibHiiGuid.h>\r
5d73d92f 25\r
28165f24
RN
26#include <Protocol/Shell.h>\r
27#include <Protocol/ShellParameters.h>\r
5d73d92f 28#include <Protocol/DevicePath.h>\r
29#include <Protocol/LoadedImage.h>\r
30#include <Protocol/UnicodeCollation.h>\r
5d73d92f 31#include <Protocol/DriverDiagnostics2.h>\r
32#include <Protocol/DriverDiagnostics.h>\r
33#include <Protocol/PlatformDriverOverride.h>\r
34#include <Protocol/BusSpecificDriverOverride.h>\r
35#include <Protocol/PlatformToDriverConfiguration.h>\r
36#include <Protocol/DriverSupportedEfiVersion.h>\r
37#include <Protocol/DriverFamilyOverride.h>\r
38#include <Protocol/DriverHealth.h>\r
3737ac2b 39#include <Protocol/SimplePointer.h>\r
304316f4 40#include <Protocol/CpuIo2.h>\r
3737ac2b 41#include <Protocol/PciRootBridgeIo.h>\r
5d73d92f 42\r
43#include <Library/BaseLib.h>\r
44#include <Library/BaseMemoryLib.h>\r
45#include <Library/DebugLib.h>\r
46#include <Library/MemoryAllocationLib.h>\r
47#include <Library/PcdLib.h>\r
48#include <Library/ShellCommandLib.h>\r
49#include <Library/ShellLib.h>\r
50#include <Library/SortLib.h>\r
51#include <Library/UefiLib.h>\r
52#include <Library/UefiRuntimeServicesTableLib.h>\r
53#include <Library/UefiBootServicesTableLib.h>\r
54#include <Library/HiiLib.h>\r
55#include <Library/FileHandleLib.h>\r
56#include <Library/DevicePathLib.h>\r
57#include <Library/PrintLib.h>\r
58#include <Library/HandleParsingLib.h>\r
59\r
60\r
61extern EFI_HANDLE gShellDebug1HiiHandle;\r
5d73d92f 62\r
5d73d92f 63/**\r
64 Function returns a system configuration table that is stored in the\r
65 EFI System Table based on the provided GUID.\r
66\r
4ff7e37b
ED
67 @param[in] TableGuid A pointer to the table's GUID type.\r
68 @param[in, out] Table On exit, a pointer to a system configuration table.\r
5d73d92f 69\r
70 @retval EFI_SUCCESS A configuration table matching TableGuid was found.\r
71 @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.\r
72**/\r
73EFI_STATUS\r
5d73d92f 74GetSystemConfigurationTable (\r
75 IN EFI_GUID *TableGuid,\r
76 IN OUT VOID **Table\r
77 );\r
78\r
79/**\r
80 Convert a string representation of a GUID to the GUID value.\r
81\r
4ff7e37b
ED
82 @param[in] StringGuid The pointer to the string containing a GUID printed.\r
83 @param[in, out] Guid The pointer to the buffer to get the GUID value.\r
5d73d92f 84**/\r
85EFI_STATUS\r
5d73d92f 86ConvertStringToGuid (\r
87 IN CONST CHAR16 *StringGuid,\r
88 IN OUT EFI_GUID *Guid\r
89 );\r
90\r
91/**\r
92 Convert a Unicode character to numerical value.\r
93\r
94 This internal function only deal with Unicode character\r
95 which maps to a valid hexadecimal ASII character, i.e.\r
96 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other\r
97 Unicode character, the value returned does not make sense.\r
98\r
99 @param Char The character to convert.\r
100\r
101 @return The numerical value converted.\r
102\r
103**/\r
104UINTN\r
5d73d92f 105HexCharToUintn (\r
106 IN CHAR16 Char\r
107 );\r
108\r
109/**\r
110 Function for 'setsize' command.\r
111\r
112 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
113 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
114**/\r
115SHELL_STATUS\r
116EFIAPI\r
117ShellCommandRunSetSize (\r
118 IN EFI_HANDLE ImageHandle,\r
119 IN EFI_SYSTEM_TABLE *SystemTable\r
120 );\r
121\r
122/**\r
123 Function for 'comp' command.\r
124\r
125 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
126 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
127**/\r
128SHELL_STATUS\r
129EFIAPI\r
130ShellCommandRunComp (\r
131 IN EFI_HANDLE ImageHandle,\r
132 IN EFI_SYSTEM_TABLE *SystemTable\r
133 );\r
134\r
135/**\r
136 Function for 'mode' command.\r
137\r
138 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
139 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
140**/\r
141SHELL_STATUS\r
142EFIAPI\r
143ShellCommandRunMode (\r
144 IN EFI_HANDLE ImageHandle,\r
145 IN EFI_SYSTEM_TABLE *SystemTable\r
146 );\r
147\r
148/**\r
149 Function for 'memmap' command.\r
150\r
151 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
152 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
153**/\r
154SHELL_STATUS\r
155EFIAPI\r
156ShellCommandRunMemMap (\r
157 IN EFI_HANDLE ImageHandle,\r
158 IN EFI_SYSTEM_TABLE *SystemTable\r
159 );\r
160\r
161/**\r
162 Function for 'compress' command.\r
163\r
164 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
165 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
166**/\r
167SHELL_STATUS\r
168EFIAPI\r
169ShellCommandRunEfiCompress (\r
170 IN EFI_HANDLE ImageHandle,\r
171 IN EFI_SYSTEM_TABLE *SystemTable\r
172 );\r
173\r
174/**\r
175 Function for 'decompress' command.\r
176\r
177 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
178 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
179**/\r
180SHELL_STATUS\r
181EFIAPI\r
182ShellCommandRunEfiDecompress (\r
183 IN EFI_HANDLE ImageHandle,\r
184 IN EFI_SYSTEM_TABLE *SystemTable\r
185 );\r
186\r
187/**\r
188 Function for 'dmem' command.\r
189\r
190 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
191 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
192**/\r
193SHELL_STATUS\r
194EFIAPI\r
195ShellCommandRunDmem (\r
196 IN EFI_HANDLE ImageHandle,\r
197 IN EFI_SYSTEM_TABLE *SystemTable\r
198 );\r
199\r
200/**\r
201 Function for 'loadpcirom' command.\r
202\r
203 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
204 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
205**/\r
206SHELL_STATUS\r
207EFIAPI\r
208ShellCommandRunLoadPciRom (\r
209 IN EFI_HANDLE ImageHandle,\r
210 IN EFI_SYSTEM_TABLE *SystemTable\r
211 );\r
212\r
213/**\r
214 Function for 'mm' command.\r
215\r
216 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
217 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
218**/\r
219SHELL_STATUS\r
220EFIAPI\r
221ShellCommandRunMm (\r
222 IN EFI_HANDLE ImageHandle,\r
223 IN EFI_SYSTEM_TABLE *SystemTable\r
224 );\r
225\r
226/**\r
227 Function for 'setvar' command.\r
228\r
229 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
230 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
231**/\r
232SHELL_STATUS\r
233EFIAPI\r
234ShellCommandRunSetVar (\r
235 IN EFI_HANDLE ImageHandle,\r
236 IN EFI_SYSTEM_TABLE *SystemTable\r
237 );\r
238\r
239/**\r
240 Function for 'sermode' command.\r
241\r
242 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
243 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
244**/\r
245SHELL_STATUS\r
246EFIAPI\r
247ShellCommandRunSerMode (\r
248 IN EFI_HANDLE ImageHandle,\r
249 IN EFI_SYSTEM_TABLE *SystemTable\r
250 );\r
251\r
252/**\r
253 Function for 'bcfg' command.\r
254\r
255 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
256 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
257**/\r
258SHELL_STATUS\r
259EFIAPI\r
260ShellCommandRunBcfg (\r
261 IN EFI_HANDLE ImageHandle,\r
262 IN EFI_SYSTEM_TABLE *SystemTable\r
263 );\r
264\r
265/**\r
266 Function for 'pci' command.\r
267\r
268 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
269 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
270**/\r
271SHELL_STATUS\r
272EFIAPI\r
273ShellCommandRunPci (\r
274 IN EFI_HANDLE ImageHandle,\r
275 IN EFI_SYSTEM_TABLE *SystemTable\r
276 );\r
277\r
278/**\r
279 Function for 'smbiosview' command.\r
280\r
281 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
282 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
283**/\r
284SHELL_STATUS\r
285EFIAPI\r
286ShellCommandRunSmbiosView (\r
287 IN EFI_HANDLE ImageHandle,\r
288 IN EFI_SYSTEM_TABLE *SystemTable\r
289 );\r
290\r
291/**\r
292 Function for 'dmpstore' command.\r
293\r
294 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
295 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
296**/\r
297SHELL_STATUS\r
298EFIAPI\r
299ShellCommandRunDmpStore (\r
300 IN EFI_HANDLE ImageHandle,\r
301 IN EFI_SYSTEM_TABLE *SystemTable\r
302 );\r
303\r
304/**\r
305 Function for 'dblk' command.\r
306\r
307 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
308 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
309**/\r
310SHELL_STATUS\r
311EFIAPI\r
312ShellCommandRunDblk (\r
313 IN EFI_HANDLE ImageHandle,\r
314 IN EFI_SYSTEM_TABLE *SystemTable\r
315 );\r
316\r
3737ac2b 317/**\r
318 Function for 'edit' command.\r
319\r
320 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
321 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
322**/\r
323SHELL_STATUS\r
324EFIAPI\r
325ShellCommandRunEdit (\r
326 IN EFI_HANDLE ImageHandle,\r
327 IN EFI_SYSTEM_TABLE *SystemTable\r
328 );\r
329\r
330/**\r
331 Function for 'hexedit' command.\r
332\r
333 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
334 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
335**/\r
336SHELL_STATUS\r
337EFIAPI\r
338ShellCommandRunHexEdit (\r
339 IN EFI_HANDLE ImageHandle,\r
340 IN EFI_SYSTEM_TABLE *SystemTable\r
341 );\r
342\r
3737ac2b 343/**\r
344 Clear the line at the specified Row.\r
345 \r
346 @param[in] Row The row number to be cleared ( start from 1 )\r
347 @param[in] LastCol The last printable column.\r
348 @param[in] LastRow The last printable row.\r
349**/\r
350VOID\r
3737ac2b 351EditorClearLine (\r
352 IN UINTN Row,\r
353 IN UINTN LastCol,\r
354 IN UINTN LastRow\r
355 );\r
356\r
357/**\r
358 Check if file name has illegal characters.\r
359 \r
360 @param Name The filename to check.\r
361\r
362 @retval TRUE The filename is ok.\r
363 @retval FALSE The filename is not ok.\r
364**/\r
365BOOLEAN\r
3737ac2b 366IsValidFileName (\r
367 IN CONST CHAR16 *Name\r
368 );\r
369\r
370/**\r
371 Find a filename that is valid (not taken) with the given extension.\r
372\r
373 @param[in] Extension The file extension.\r
374\r
375 @retval NULL Something went wrong.\r
376 @return the valid filename.\r
377**/\r
378CHAR16 *\r
3737ac2b 379EditGetDefaultFileName (\r
380 IN CONST CHAR16 *Extension\r
381 );\r
382\r
383/**\r
384 Read a file into an allocated buffer. The buffer is the responsibility \r
385 of the caller to free.\r
386\r
387 @param[in] FileName The filename of the file to open.\r
388 @param[out] Buffer Upon successful return, the pointer to the \r
389 address of the allocated buffer. \r
390 @param[out] BufferSize If not NULL, then the pointer to the size\r
391 of the allocated buffer.\r
392 @param[out] ReadOnly Upon successful return TRUE if the file is\r
393 read only. FALSE otherwise.\r
394\r
395 @retval EFI_NOT_FOUND The filename did not represent a file in the \r
396 file system. Directories cannot be read with\r
397 this method.\r
398 @retval EFI_SUCCESS The file was read into the buffer.\r
399 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
400 @retval EFI_LOAD_ERROR The file read operation failed.\r
401 @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
402 @retval EFI_INVALID_PARAMETER FileName was NULL.\r
403 @retval EFI_INVALID_PARAMETER FileName was a directory.\r
404**/\r
405EFI_STATUS\r
3737ac2b 406ReadFileIntoBuffer (\r
407 IN CONST CHAR16 *FileName,\r
408 OUT VOID **Buffer,\r
409 OUT UINTN *BufferSize OPTIONAL,\r
410 OUT BOOLEAN *ReadOnly\r
411 );\r
5d73d92f 412\r
3737ac2b 413#endif\r