2 Main file for NULL named library for Profile1 shell command functions.
4 Copyright (c) 2010 - 2015, 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_
19 #include <ShellBase.h>
21 #include <Guid/GlobalVariable.h>
22 #include <Guid/ConsoleInDevice.h>
23 #include <Guid/ConsoleOutDevice.h>
24 #include <Guid/FileSystemInfo.h>
25 #include <Guid/ShellLibHiiGuid.h>
27 #include <Protocol/EfiShell.h>
28 #include <Protocol/EfiShellParameters.h>
29 #include <Protocol/DevicePath.h>
30 #include <Protocol/LoadedImage.h>
31 #include <Protocol/UnicodeCollation.h>
32 #include <Protocol/DriverDiagnostics2.h>
33 #include <Protocol/DriverDiagnostics.h>
34 #include <Protocol/PlatformDriverOverride.h>
35 #include <Protocol/BusSpecificDriverOverride.h>
36 #include <Protocol/PlatformToDriverConfiguration.h>
37 #include <Protocol/DriverSupportedEfiVersion.h>
38 #include <Protocol/DriverFamilyOverride.h>
39 #include <Protocol/DriverHealth.h>
40 #include <Protocol/SimplePointer.h>
41 #include <Protocol/CpuIo2.h>
42 #include <Protocol/PciRootBridgeIo.h>
44 #include <Library/BaseLib.h>
45 #include <Library/BaseMemoryLib.h>
46 #include <Library/DebugLib.h>
47 #include <Library/MemoryAllocationLib.h>
48 #include <Library/PcdLib.h>
49 #include <Library/ShellCommandLib.h>
50 #include <Library/ShellLib.h>
51 #include <Library/SortLib.h>
52 #include <Library/UefiLib.h>
53 #include <Library/UefiRuntimeServicesTableLib.h>
54 #include <Library/UefiBootServicesTableLib.h>
55 #include <Library/HiiLib.h>
56 #include <Library/FileHandleLib.h>
57 #include <Library/DevicePathLib.h>
58 #include <Library/PrintLib.h>
59 #include <Library/HandleParsingLib.h>
62 extern EFI_HANDLE gShellDebug1HiiHandle
;
65 Function returns a system configuration table that is stored in the
66 EFI System Table based on the provided GUID.
68 @param[in] TableGuid A pointer to the table's GUID type.
69 @param[in, out] Table On exit, a pointer to a system configuration table.
71 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
72 @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
76 GetSystemConfigurationTable (
77 IN EFI_GUID
*TableGuid
,
82 Convert a string representation of a GUID to the GUID value.
84 @param[in] StringGuid The pointer to the string containing a GUID printed.
85 @param[in, out] Guid The pointer to the buffer to get the GUID value.
90 IN CONST CHAR16
*StringGuid
,
95 Convert a Unicode character to numerical value.
97 This internal function only deal with Unicode character
98 which maps to a valid hexadecimal ASII character, i.e.
99 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
100 Unicode character, the value returned does not make sense.
102 @param Char The character to convert.
104 @return The numerical value converted.
114 Function for 'setsize' command.
116 @param[in] ImageHandle Handle to the Image (NULL if Internal).
117 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
121 ShellCommandRunSetSize (
122 IN EFI_HANDLE ImageHandle
,
123 IN EFI_SYSTEM_TABLE
*SystemTable
127 Function for 'comp' command.
129 @param[in] ImageHandle Handle to the Image (NULL if Internal).
130 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
134 ShellCommandRunComp (
135 IN EFI_HANDLE ImageHandle
,
136 IN EFI_SYSTEM_TABLE
*SystemTable
140 Function for 'mode' command.
142 @param[in] ImageHandle Handle to the Image (NULL if Internal).
143 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
147 ShellCommandRunMode (
148 IN EFI_HANDLE ImageHandle
,
149 IN EFI_SYSTEM_TABLE
*SystemTable
153 Function for 'memmap' command.
155 @param[in] ImageHandle Handle to the Image (NULL if Internal).
156 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
160 ShellCommandRunMemMap (
161 IN EFI_HANDLE ImageHandle
,
162 IN EFI_SYSTEM_TABLE
*SystemTable
166 Function for 'compress' command.
168 @param[in] ImageHandle Handle to the Image (NULL if Internal).
169 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
173 ShellCommandRunEfiCompress (
174 IN EFI_HANDLE ImageHandle
,
175 IN EFI_SYSTEM_TABLE
*SystemTable
179 Function for 'decompress' command.
181 @param[in] ImageHandle Handle to the Image (NULL if Internal).
182 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
186 ShellCommandRunEfiDecompress (
187 IN EFI_HANDLE ImageHandle
,
188 IN EFI_SYSTEM_TABLE
*SystemTable
192 Function for 'dmem' command.
194 @param[in] ImageHandle Handle to the Image (NULL if Internal).
195 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
199 ShellCommandRunDmem (
200 IN EFI_HANDLE ImageHandle
,
201 IN EFI_SYSTEM_TABLE
*SystemTable
205 Function for 'loadpcirom' command.
207 @param[in] ImageHandle Handle to the Image (NULL if Internal).
208 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
212 ShellCommandRunLoadPciRom (
213 IN EFI_HANDLE ImageHandle
,
214 IN EFI_SYSTEM_TABLE
*SystemTable
218 Function for 'mm' command.
220 @param[in] ImageHandle Handle to the Image (NULL if Internal).
221 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
226 IN EFI_HANDLE ImageHandle
,
227 IN EFI_SYSTEM_TABLE
*SystemTable
231 Function for 'setvar' command.
233 @param[in] ImageHandle Handle to the Image (NULL if Internal).
234 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
238 ShellCommandRunSetVar (
239 IN EFI_HANDLE ImageHandle
,
240 IN EFI_SYSTEM_TABLE
*SystemTable
244 Function for 'sermode' command.
246 @param[in] ImageHandle Handle to the Image (NULL if Internal).
247 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
251 ShellCommandRunSerMode (
252 IN EFI_HANDLE ImageHandle
,
253 IN EFI_SYSTEM_TABLE
*SystemTable
257 Function for 'bcfg' command.
259 @param[in] ImageHandle Handle to the Image (NULL if Internal).
260 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
264 ShellCommandRunBcfg (
265 IN EFI_HANDLE ImageHandle
,
266 IN EFI_SYSTEM_TABLE
*SystemTable
270 Function for 'pci' command.
272 @param[in] ImageHandle Handle to the Image (NULL if Internal).
273 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
278 IN EFI_HANDLE ImageHandle
,
279 IN EFI_SYSTEM_TABLE
*SystemTable
283 Function for 'smbiosview' command.
285 @param[in] ImageHandle Handle to the Image (NULL if Internal).
286 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
290 ShellCommandRunSmbiosView (
291 IN EFI_HANDLE ImageHandle
,
292 IN EFI_SYSTEM_TABLE
*SystemTable
296 Function for 'dmpstore' command.
298 @param[in] ImageHandle Handle to the Image (NULL if Internal).
299 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
303 ShellCommandRunDmpStore (
304 IN EFI_HANDLE ImageHandle
,
305 IN EFI_SYSTEM_TABLE
*SystemTable
309 Function for 'dblk' command.
311 @param[in] ImageHandle Handle to the Image (NULL if Internal).
312 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
316 ShellCommandRunDblk (
317 IN EFI_HANDLE ImageHandle
,
318 IN EFI_SYSTEM_TABLE
*SystemTable
322 Function for 'edit' command.
324 @param[in] ImageHandle Handle to the Image (NULL if Internal).
325 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
329 ShellCommandRunEdit (
330 IN EFI_HANDLE ImageHandle
,
331 IN EFI_SYSTEM_TABLE
*SystemTable
335 Function for 'hexedit' command.
337 @param[in] ImageHandle Handle to the Image (NULL if Internal).
338 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
342 ShellCommandRunHexEdit (
343 IN EFI_HANDLE ImageHandle
,
344 IN EFI_SYSTEM_TABLE
*SystemTable
348 Clear the line at the specified Row.
350 @param[in] Row The row number to be cleared ( start from 1 )
351 @param[in] LastCol The last printable column.
352 @param[in] LastRow The last printable row.
363 Check if file name has illegal characters.
365 @param Name The filename to check.
367 @retval TRUE The filename is ok.
368 @retval FALSE The filename is not ok.
373 IN CONST CHAR16
*Name
377 Find a filename that is valid (not taken) with the given extension.
379 @param[in] Extension The file extension.
381 @retval NULL Something went wrong.
382 @return the valid filename.
386 EditGetDefaultFileName (
387 IN CONST CHAR16
*Extension
391 Read a file into an allocated buffer. The buffer is the responsibility
392 of the caller to free.
394 @param[in] FileName The filename of the file to open.
395 @param[out] Buffer Upon successful return, the pointer to the
396 address of the allocated buffer.
397 @param[out] BufferSize If not NULL, then the pointer to the size
398 of the allocated buffer.
399 @param[out] ReadOnly Upon successful return TRUE if the file is
400 read only. FALSE otherwise.
402 @retval EFI_NOT_FOUND The filename did not represent a file in the
403 file system. Directories cannot be read with
405 @retval EFI_SUCCESS The file was read into the buffer.
406 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
407 @retval EFI_LOAD_ERROR The file read operation failed.
408 @retval EFI_INVALID_PARAMETER A parameter was invalid.
409 @retval EFI_INVALID_PARAMETER FileName was NULL.
410 @retval EFI_INVALID_PARAMETER FileName was a directory.
415 IN CONST CHAR16
*FileName
,
417 OUT UINTN
*BufferSize OPTIONAL
,
418 OUT BOOLEAN
*ReadOnly