2 Main file for NULL named library for Profile1 shell command functions.
4 Copyright (c) 2010 - 2018, 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 Function for 'setsize' command.
82 @param[in] ImageHandle Handle to the Image (NULL if Internal).
83 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
87 ShellCommandRunSetSize (
88 IN EFI_HANDLE ImageHandle
,
89 IN EFI_SYSTEM_TABLE
*SystemTable
93 Function for 'comp' command.
95 @param[in] ImageHandle Handle to the Image (NULL if Internal).
96 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
100 ShellCommandRunComp (
101 IN EFI_HANDLE ImageHandle
,
102 IN EFI_SYSTEM_TABLE
*SystemTable
106 Function for 'mode' command.
108 @param[in] ImageHandle Handle to the Image (NULL if Internal).
109 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
113 ShellCommandRunMode (
114 IN EFI_HANDLE ImageHandle
,
115 IN EFI_SYSTEM_TABLE
*SystemTable
119 Function for 'memmap' command.
121 @param[in] ImageHandle Handle to the Image (NULL if Internal).
122 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
126 ShellCommandRunMemMap (
127 IN EFI_HANDLE ImageHandle
,
128 IN EFI_SYSTEM_TABLE
*SystemTable
132 Function for 'compress' command.
134 @param[in] ImageHandle Handle to the Image (NULL if Internal).
135 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
139 ShellCommandRunEfiCompress (
140 IN EFI_HANDLE ImageHandle
,
141 IN EFI_SYSTEM_TABLE
*SystemTable
145 Function for 'decompress' command.
147 @param[in] ImageHandle Handle to the Image (NULL if Internal).
148 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
152 ShellCommandRunEfiDecompress (
153 IN EFI_HANDLE ImageHandle
,
154 IN EFI_SYSTEM_TABLE
*SystemTable
158 Function for 'dmem' command.
160 @param[in] ImageHandle Handle to the Image (NULL if Internal).
161 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
165 ShellCommandRunDmem (
166 IN EFI_HANDLE ImageHandle
,
167 IN EFI_SYSTEM_TABLE
*SystemTable
171 Function for 'loadpcirom' command.
173 @param[in] ImageHandle Handle to the Image (NULL if Internal).
174 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
178 ShellCommandRunLoadPciRom (
179 IN EFI_HANDLE ImageHandle
,
180 IN EFI_SYSTEM_TABLE
*SystemTable
184 Function for 'mm' command.
186 @param[in] ImageHandle Handle to the Image (NULL if Internal).
187 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
192 IN EFI_HANDLE ImageHandle
,
193 IN EFI_SYSTEM_TABLE
*SystemTable
197 Function for 'setvar' command.
199 @param[in] ImageHandle Handle to the Image (NULL if Internal).
200 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
204 ShellCommandRunSetVar (
205 IN EFI_HANDLE ImageHandle
,
206 IN EFI_SYSTEM_TABLE
*SystemTable
210 Function for 'sermode' command.
212 @param[in] ImageHandle Handle to the Image (NULL if Internal).
213 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
217 ShellCommandRunSerMode (
218 IN EFI_HANDLE ImageHandle
,
219 IN EFI_SYSTEM_TABLE
*SystemTable
223 Function for 'bcfg' command.
225 @param[in] ImageHandle Handle to the Image (NULL if Internal).
226 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
230 ShellCommandRunBcfg (
231 IN EFI_HANDLE ImageHandle
,
232 IN EFI_SYSTEM_TABLE
*SystemTable
236 Function for 'pci' command.
238 @param[in] ImageHandle Handle to the Image (NULL if Internal).
239 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
244 IN EFI_HANDLE ImageHandle
,
245 IN EFI_SYSTEM_TABLE
*SystemTable
249 Function for 'smbiosview' command.
251 @param[in] ImageHandle Handle to the Image (NULL if Internal).
252 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
256 ShellCommandRunSmbiosView (
257 IN EFI_HANDLE ImageHandle
,
258 IN EFI_SYSTEM_TABLE
*SystemTable
262 Function for 'dmpstore' command.
264 @param[in] ImageHandle Handle to the Image (NULL if Internal).
265 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
269 ShellCommandRunDmpStore (
270 IN EFI_HANDLE ImageHandle
,
271 IN EFI_SYSTEM_TABLE
*SystemTable
275 Function for 'dblk' command.
277 @param[in] ImageHandle Handle to the Image (NULL if Internal).
278 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
282 ShellCommandRunDblk (
283 IN EFI_HANDLE ImageHandle
,
284 IN EFI_SYSTEM_TABLE
*SystemTable
288 Function for 'edit' command.
290 @param[in] ImageHandle Handle to the Image (NULL if Internal).
291 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
295 ShellCommandRunEdit (
296 IN EFI_HANDLE ImageHandle
,
297 IN EFI_SYSTEM_TABLE
*SystemTable
301 Function for 'hexedit' command.
303 @param[in] ImageHandle Handle to the Image (NULL if Internal).
304 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
308 ShellCommandRunHexEdit (
309 IN EFI_HANDLE ImageHandle
,
310 IN EFI_SYSTEM_TABLE
*SystemTable
314 Clear the line at the specified Row.
316 @param[in] Row The row number to be cleared ( start from 1 )
317 @param[in] LastCol The last printable column.
318 @param[in] LastRow The last printable row.
328 Check if file name has illegal characters.
330 @param Name The filename to check.
332 @retval TRUE The filename is ok.
333 @retval FALSE The filename is not ok.
337 IN CONST CHAR16
*Name
341 Find a filename that is valid (not taken) with the given extension.
343 @param[in] Extension The file extension.
345 @retval NULL Something went wrong.
346 @return the valid filename.
349 EditGetDefaultFileName (
350 IN CONST CHAR16
*Extension
354 Read a file into an allocated buffer. The buffer is the responsibility
355 of the caller to free.
357 @param[in] FileName The filename of the file to open.
358 @param[out] Buffer Upon successful return, the pointer to the
359 address of the allocated buffer.
360 @param[out] BufferSize If not NULL, then the pointer to the size
361 of the allocated buffer.
362 @param[out] ReadOnly Upon successful return TRUE if the file is
363 read only. FALSE otherwise.
365 @retval EFI_NOT_FOUND The filename did not represent a file in the
366 file system. Directories cannot be read with
368 @retval EFI_SUCCESS The file was read into the buffer.
369 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
370 @retval EFI_LOAD_ERROR The file read operation failed.
371 @retval EFI_INVALID_PARAMETER A parameter was invalid.
372 @retval EFI_INVALID_PARAMETER FileName was NULL.
373 @retval EFI_INVALID_PARAMETER FileName was a directory.
377 IN CONST CHAR16
*FileName
,
379 OUT UINTN
*BufferSize OPTIONAL
,
380 OUT BOOLEAN
*ReadOnly