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