2 Main file for NULL named library for Profile1 shell command functions.
4 Copyright (c) 2010 - 2016, 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
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.
15 #ifndef _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
16 #define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
20 #include <Guid/GlobalVariable.h>
21 #include <Guid/ConsoleInDevice.h>
22 #include <Guid/ConsoleOutDevice.h>
23 #include <Guid/FileSystemInfo.h>
24 #include <Guid/ShellLibHiiGuid.h>
26 #include <Protocol/Shell.h>
27 #include <Protocol/ShellParameters.h>
28 #include <Protocol/DevicePath.h>
29 #include <Protocol/LoadedImage.h>
30 #include <Protocol/UnicodeCollation.h>
31 #include <Protocol/DriverDiagnostics2.h>
32 #include <Protocol/DriverDiagnostics.h>
33 #include <Protocol/PlatformDriverOverride.h>
34 #include <Protocol/BusSpecificDriverOverride.h>
35 #include <Protocol/PlatformToDriverConfiguration.h>
36 #include <Protocol/DriverSupportedEfiVersion.h>
37 #include <Protocol/DriverFamilyOverride.h>
38 #include <Protocol/DriverHealth.h>
39 #include <Protocol/SimplePointer.h>
40 #include <Protocol/CpuIo2.h>
41 #include <Protocol/PciRootBridgeIo.h>
43 #include <Library/BaseLib.h>
44 #include <Library/BaseMemoryLib.h>
45 #include <Library/DebugLib.h>
46 #include <Library/MemoryAllocationLib.h>
47 #include <Library/PcdLib.h>
48 #include <Library/ShellCommandLib.h>
49 #include <Library/ShellLib.h>
50 #include <Library/SortLib.h>
51 #include <Library/UefiLib.h>
52 #include <Library/UefiRuntimeServicesTableLib.h>
53 #include <Library/UefiBootServicesTableLib.h>
54 #include <Library/HiiLib.h>
55 #include <Library/FileHandleLib.h>
56 #include <Library/DevicePathLib.h>
57 #include <Library/PrintLib.h>
58 #include <Library/HandleParsingLib.h>
61 extern EFI_HANDLE gShellDebug1HiiHandle
;
64 Function returns a system configuration table that is stored in the
65 EFI System Table based on the provided GUID.
67 @param[in] TableGuid A pointer to the table's GUID type.
68 @param[in, out] Table On exit, a pointer to a system configuration table.
70 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
71 @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
74 GetSystemConfigurationTable (
75 IN EFI_GUID
*TableGuid
,
80 Convert a string representation of a GUID to the GUID value.
82 @param[in] StringGuid The pointer to the string containing a GUID printed.
83 @param[in, out] Guid The pointer to the buffer to get the GUID value.
87 IN CONST CHAR16
*StringGuid
,
92 Convert a Unicode character to numerical value.
94 This internal function only deal with Unicode character
95 which maps to a valid hexadecimal ASII character, i.e.
96 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
97 Unicode character, the value returned does not make sense.
99 @param Char The character to convert.
101 @return The numerical value converted.
110 Function for 'setsize' command.
112 @param[in] ImageHandle Handle to the Image (NULL if Internal).
113 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
117 ShellCommandRunSetSize (
118 IN EFI_HANDLE ImageHandle
,
119 IN EFI_SYSTEM_TABLE
*SystemTable
123 Function for 'comp' command.
125 @param[in] ImageHandle Handle to the Image (NULL if Internal).
126 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
130 ShellCommandRunComp (
131 IN EFI_HANDLE ImageHandle
,
132 IN EFI_SYSTEM_TABLE
*SystemTable
136 Function for 'mode' command.
138 @param[in] ImageHandle Handle to the Image (NULL if Internal).
139 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
143 ShellCommandRunMode (
144 IN EFI_HANDLE ImageHandle
,
145 IN EFI_SYSTEM_TABLE
*SystemTable
149 Function for 'memmap' command.
151 @param[in] ImageHandle Handle to the Image (NULL if Internal).
152 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
156 ShellCommandRunMemMap (
157 IN EFI_HANDLE ImageHandle
,
158 IN EFI_SYSTEM_TABLE
*SystemTable
162 Function for 'compress' command.
164 @param[in] ImageHandle Handle to the Image (NULL if Internal).
165 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
169 ShellCommandRunEfiCompress (
170 IN EFI_HANDLE ImageHandle
,
171 IN EFI_SYSTEM_TABLE
*SystemTable
175 Function for 'decompress' command.
177 @param[in] ImageHandle Handle to the Image (NULL if Internal).
178 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
182 ShellCommandRunEfiDecompress (
183 IN EFI_HANDLE ImageHandle
,
184 IN EFI_SYSTEM_TABLE
*SystemTable
188 Function for 'dmem' command.
190 @param[in] ImageHandle Handle to the Image (NULL if Internal).
191 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
195 ShellCommandRunDmem (
196 IN EFI_HANDLE ImageHandle
,
197 IN EFI_SYSTEM_TABLE
*SystemTable
201 Function for 'loadpcirom' command.
203 @param[in] ImageHandle Handle to the Image (NULL if Internal).
204 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
208 ShellCommandRunLoadPciRom (
209 IN EFI_HANDLE ImageHandle
,
210 IN EFI_SYSTEM_TABLE
*SystemTable
214 Function for 'mm' command.
216 @param[in] ImageHandle Handle to the Image (NULL if Internal).
217 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
222 IN EFI_HANDLE ImageHandle
,
223 IN EFI_SYSTEM_TABLE
*SystemTable
227 Function for 'setvar' command.
229 @param[in] ImageHandle Handle to the Image (NULL if Internal).
230 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
234 ShellCommandRunSetVar (
235 IN EFI_HANDLE ImageHandle
,
236 IN EFI_SYSTEM_TABLE
*SystemTable
240 Function for 'sermode' command.
242 @param[in] ImageHandle Handle to the Image (NULL if Internal).
243 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
247 ShellCommandRunSerMode (
248 IN EFI_HANDLE ImageHandle
,
249 IN EFI_SYSTEM_TABLE
*SystemTable
253 Function for 'bcfg' command.
255 @param[in] ImageHandle Handle to the Image (NULL if Internal).
256 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
260 ShellCommandRunBcfg (
261 IN EFI_HANDLE ImageHandle
,
262 IN EFI_SYSTEM_TABLE
*SystemTable
266 Function for 'pci' command.
268 @param[in] ImageHandle Handle to the Image (NULL if Internal).
269 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
274 IN EFI_HANDLE ImageHandle
,
275 IN EFI_SYSTEM_TABLE
*SystemTable
279 Function for 'smbiosview' command.
281 @param[in] ImageHandle Handle to the Image (NULL if Internal).
282 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
286 ShellCommandRunSmbiosView (
287 IN EFI_HANDLE ImageHandle
,
288 IN EFI_SYSTEM_TABLE
*SystemTable
292 Function for 'dmpstore' command.
294 @param[in] ImageHandle Handle to the Image (NULL if Internal).
295 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
299 ShellCommandRunDmpStore (
300 IN EFI_HANDLE ImageHandle
,
301 IN EFI_SYSTEM_TABLE
*SystemTable
305 Function for 'dblk' command.
307 @param[in] ImageHandle Handle to the Image (NULL if Internal).
308 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
312 ShellCommandRunDblk (
313 IN EFI_HANDLE ImageHandle
,
314 IN EFI_SYSTEM_TABLE
*SystemTable
318 Function for 'edit' command.
320 @param[in] ImageHandle Handle to the Image (NULL if Internal).
321 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
325 ShellCommandRunEdit (
326 IN EFI_HANDLE ImageHandle
,
327 IN EFI_SYSTEM_TABLE
*SystemTable
331 Function for 'hexedit' command.
333 @param[in] ImageHandle Handle to the Image (NULL if Internal).
334 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
338 ShellCommandRunHexEdit (
339 IN EFI_HANDLE ImageHandle
,
340 IN EFI_SYSTEM_TABLE
*SystemTable
344 Clear the line at the specified Row.
346 @param[in] Row The row number to be cleared ( start from 1 )
347 @param[in] LastCol The last printable column.
348 @param[in] LastRow The last printable row.
358 Check if file name has illegal characters.
360 @param Name The filename to check.
362 @retval TRUE The filename is ok.
363 @retval FALSE The filename is not ok.
367 IN CONST CHAR16
*Name
371 Find a filename that is valid (not taken) with the given extension.
373 @param[in] Extension The file extension.
375 @retval NULL Something went wrong.
376 @return the valid filename.
379 EditGetDefaultFileName (
380 IN CONST CHAR16
*Extension
384 Read a file into an allocated buffer. The buffer is the responsibility
385 of the caller to free.
387 @param[in] FileName The filename of the file to open.
388 @param[out] Buffer Upon successful return, the pointer to the
389 address of the allocated buffer.
390 @param[out] BufferSize If not NULL, then the pointer to the size
391 of the allocated buffer.
392 @param[out] ReadOnly Upon successful return TRUE if the file is
393 read only. FALSE otherwise.
395 @retval EFI_NOT_FOUND The filename did not represent a file in the
396 file system. Directories cannot be read with
398 @retval EFI_SUCCESS The file was read into the buffer.
399 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
400 @retval EFI_LOAD_ERROR The file read operation failed.
401 @retval EFI_INVALID_PARAMETER A parameter was invalid.
402 @retval EFI_INVALID_PARAMETER FileName was NULL.
403 @retval EFI_INVALID_PARAMETER FileName was a directory.
407 IN CONST CHAR16
*FileName
,
409 OUT UINTN
*BufferSize OPTIONAL
,
410 OUT BOOLEAN
*ReadOnly