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