]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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
ba0014b9 4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
56ba3746 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
5d73d92f 6\r
7**/\r
8\r
a1d4bfcc 9#ifndef _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_\r
3737ac2b 10#define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_\r
11\r
5d73d92f 12#include <Uefi.h>\r
5d73d92f 13\r
14#include <Guid/GlobalVariable.h>\r
15#include <Guid/ConsoleInDevice.h>\r
16#include <Guid/ConsoleOutDevice.h>\r
3737ac2b 17#include <Guid/FileSystemInfo.h>\r
bca163ff 18#include <Guid/ShellLibHiiGuid.h>\r
5d73d92f 19\r
28165f24
RN
20#include <Protocol/Shell.h>\r
21#include <Protocol/ShellParameters.h>\r
5d73d92f 22#include <Protocol/DevicePath.h>\r
23#include <Protocol/LoadedImage.h>\r
24#include <Protocol/UnicodeCollation.h>\r
5d73d92f 25#include <Protocol/DriverDiagnostics2.h>\r
26#include <Protocol/DriverDiagnostics.h>\r
27#include <Protocol/PlatformDriverOverride.h>\r
28#include <Protocol/BusSpecificDriverOverride.h>\r
29#include <Protocol/PlatformToDriverConfiguration.h>\r
30#include <Protocol/DriverSupportedEfiVersion.h>\r
31#include <Protocol/DriverFamilyOverride.h>\r
32#include <Protocol/DriverHealth.h>\r
3737ac2b 33#include <Protocol/SimplePointer.h>\r
304316f4 34#include <Protocol/CpuIo2.h>\r
3737ac2b 35#include <Protocol/PciRootBridgeIo.h>\r
5d73d92f 36\r
37#include <Library/BaseLib.h>\r
38#include <Library/BaseMemoryLib.h>\r
39#include <Library/DebugLib.h>\r
40#include <Library/MemoryAllocationLib.h>\r
41#include <Library/PcdLib.h>\r
42#include <Library/ShellCommandLib.h>\r
43#include <Library/ShellLib.h>\r
44#include <Library/SortLib.h>\r
45#include <Library/UefiLib.h>\r
46#include <Library/UefiRuntimeServicesTableLib.h>\r
47#include <Library/UefiBootServicesTableLib.h>\r
48#include <Library/HiiLib.h>\r
49#include <Library/FileHandleLib.h>\r
50#include <Library/DevicePathLib.h>\r
51#include <Library/PrintLib.h>\r
52#include <Library/HandleParsingLib.h>\r
53\r
47d20b54 54extern EFI_HII_HANDLE gShellDebug1HiiHandle;\r
5d73d92f 55\r
5d73d92f 56/**\r
57 Function returns a system configuration table that is stored in the\r
58 EFI System Table based on the provided GUID.\r
59\r
4ff7e37b
ED
60 @param[in] TableGuid A pointer to the table's GUID type.\r
61 @param[in, out] Table On exit, a pointer to a system configuration table.\r
5d73d92f 62\r
63 @retval EFI_SUCCESS A configuration table matching TableGuid was found.\r
64 @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.\r
65**/\r
66EFI_STATUS\r
5d73d92f 67GetSystemConfigurationTable (\r
47d20b54
MK
68 IN EFI_GUID *TableGuid,\r
69 IN OUT VOID **Table\r
5d73d92f 70 );\r
71\r
5d73d92f 72/**\r
73 Function for 'setsize' command.\r
74\r
75 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
76 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
77**/\r
78SHELL_STATUS\r
79EFIAPI\r
80ShellCommandRunSetSize (\r
81 IN EFI_HANDLE ImageHandle,\r
82 IN EFI_SYSTEM_TABLE *SystemTable\r
83 );\r
84\r
85/**\r
86 Function for 'comp' command.\r
87\r
88 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
89 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
90**/\r
91SHELL_STATUS\r
92EFIAPI\r
93ShellCommandRunComp (\r
94 IN EFI_HANDLE ImageHandle,\r
95 IN EFI_SYSTEM_TABLE *SystemTable\r
96 );\r
97\r
98/**\r
99 Function for 'mode' command.\r
100\r
101 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
102 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
103**/\r
104SHELL_STATUS\r
105EFIAPI\r
106ShellCommandRunMode (\r
107 IN EFI_HANDLE ImageHandle,\r
108 IN EFI_SYSTEM_TABLE *SystemTable\r
109 );\r
110\r
111/**\r
112 Function for 'memmap' command.\r
113\r
114 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
115 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
116**/\r
117SHELL_STATUS\r
118EFIAPI\r
119ShellCommandRunMemMap (\r
120 IN EFI_HANDLE ImageHandle,\r
121 IN EFI_SYSTEM_TABLE *SystemTable\r
122 );\r
123\r
124/**\r
125 Function for 'compress' command.\r
126\r
127 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
128 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
129**/\r
130SHELL_STATUS\r
131EFIAPI\r
132ShellCommandRunEfiCompress (\r
133 IN EFI_HANDLE ImageHandle,\r
134 IN EFI_SYSTEM_TABLE *SystemTable\r
135 );\r
136\r
137/**\r
138 Function for 'decompress' command.\r
139\r
140 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
141 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
142**/\r
143SHELL_STATUS\r
144EFIAPI\r
145ShellCommandRunEfiDecompress (\r
146 IN EFI_HANDLE ImageHandle,\r
147 IN EFI_SYSTEM_TABLE *SystemTable\r
148 );\r
149\r
150/**\r
151 Function for 'dmem' command.\r
152\r
153 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
154 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
155**/\r
156SHELL_STATUS\r
157EFIAPI\r
158ShellCommandRunDmem (\r
159 IN EFI_HANDLE ImageHandle,\r
160 IN EFI_SYSTEM_TABLE *SystemTable\r
161 );\r
162\r
163/**\r
164 Function for 'loadpcirom' command.\r
165\r
166 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
167 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
168**/\r
169SHELL_STATUS\r
170EFIAPI\r
171ShellCommandRunLoadPciRom (\r
172 IN EFI_HANDLE ImageHandle,\r
173 IN EFI_SYSTEM_TABLE *SystemTable\r
174 );\r
175\r
176/**\r
177 Function for 'mm' command.\r
178\r
179 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
180 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
181**/\r
182SHELL_STATUS\r
183EFIAPI\r
184ShellCommandRunMm (\r
185 IN EFI_HANDLE ImageHandle,\r
186 IN EFI_SYSTEM_TABLE *SystemTable\r
187 );\r
188\r
189/**\r
190 Function for 'setvar' command.\r
191\r
192 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
193 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
194**/\r
195SHELL_STATUS\r
196EFIAPI\r
197ShellCommandRunSetVar (\r
198 IN EFI_HANDLE ImageHandle,\r
199 IN EFI_SYSTEM_TABLE *SystemTable\r
200 );\r
201\r
202/**\r
203 Function for 'sermode' command.\r
204\r
205 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
206 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
207**/\r
208SHELL_STATUS\r
209EFIAPI\r
210ShellCommandRunSerMode (\r
211 IN EFI_HANDLE ImageHandle,\r
212 IN EFI_SYSTEM_TABLE *SystemTable\r
213 );\r
214\r
215/**\r
216 Function for 'bcfg' command.\r
217\r
218 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
219 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
220**/\r
221SHELL_STATUS\r
222EFIAPI\r
223ShellCommandRunBcfg (\r
224 IN EFI_HANDLE ImageHandle,\r
225 IN EFI_SYSTEM_TABLE *SystemTable\r
226 );\r
227\r
228/**\r
229 Function for 'pci' command.\r
230\r
231 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
232 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
233**/\r
234SHELL_STATUS\r
235EFIAPI\r
236ShellCommandRunPci (\r
237 IN EFI_HANDLE ImageHandle,\r
238 IN EFI_SYSTEM_TABLE *SystemTable\r
239 );\r
240\r
241/**\r
242 Function for 'smbiosview' command.\r
243\r
244 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
245 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
246**/\r
247SHELL_STATUS\r
248EFIAPI\r
249ShellCommandRunSmbiosView (\r
250 IN EFI_HANDLE ImageHandle,\r
251 IN EFI_SYSTEM_TABLE *SystemTable\r
252 );\r
253\r
254/**\r
255 Function for 'dmpstore' command.\r
256\r
257 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
258 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
259**/\r
260SHELL_STATUS\r
261EFIAPI\r
262ShellCommandRunDmpStore (\r
263 IN EFI_HANDLE ImageHandle,\r
264 IN EFI_SYSTEM_TABLE *SystemTable\r
265 );\r
266\r
267/**\r
268 Function for 'dblk' command.\r
269\r
270 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
271 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
272**/\r
273SHELL_STATUS\r
274EFIAPI\r
275ShellCommandRunDblk (\r
276 IN EFI_HANDLE ImageHandle,\r
277 IN EFI_SYSTEM_TABLE *SystemTable\r
278 );\r
279\r
3737ac2b 280/**\r
281 Function for 'edit' command.\r
282\r
283 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
284 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
285**/\r
286SHELL_STATUS\r
287EFIAPI\r
288ShellCommandRunEdit (\r
289 IN EFI_HANDLE ImageHandle,\r
290 IN EFI_SYSTEM_TABLE *SystemTable\r
291 );\r
292\r
293/**\r
294 Function for 'hexedit' command.\r
295\r
296 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
297 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
298**/\r
299SHELL_STATUS\r
300EFIAPI\r
301ShellCommandRunHexEdit (\r
302 IN EFI_HANDLE ImageHandle,\r
303 IN EFI_SYSTEM_TABLE *SystemTable\r
304 );\r
305\r
3737ac2b 306/**\r
307 Clear the line at the specified Row.\r
ba0014b9 308\r
3737ac2b 309 @param[in] Row The row number to be cleared ( start from 1 )\r
310 @param[in] LastCol The last printable column.\r
311 @param[in] LastRow The last printable row.\r
312**/\r
313VOID\r
3737ac2b 314EditorClearLine (\r
47d20b54
MK
315 IN UINTN Row,\r
316 IN UINTN LastCol,\r
317 IN UINTN LastRow\r
3737ac2b 318 );\r
319\r
320/**\r
321 Check if file name has illegal characters.\r
ba0014b9 322\r
3737ac2b 323 @param Name The filename to check.\r
324\r
325 @retval TRUE The filename is ok.\r
326 @retval FALSE The filename is not ok.\r
327**/\r
328BOOLEAN\r
3737ac2b 329IsValidFileName (\r
47d20b54 330 IN CONST CHAR16 *Name\r
3737ac2b 331 );\r
332\r
333/**\r
334 Find a filename that is valid (not taken) with the given extension.\r
335\r
336 @param[in] Extension The file extension.\r
337\r
338 @retval NULL Something went wrong.\r
339 @return the valid filename.\r
340**/\r
341CHAR16 *\r
3737ac2b 342EditGetDefaultFileName (\r
47d20b54 343 IN CONST CHAR16 *Extension\r
3737ac2b 344 );\r
345\r
346/**\r
ba0014b9 347 Read a file into an allocated buffer. The buffer is the responsibility\r
3737ac2b 348 of the caller to free.\r
349\r
350 @param[in] FileName The filename of the file to open.\r
ba0014b9
LG
351 @param[out] Buffer Upon successful return, the pointer to the\r
352 address of the allocated buffer.\r
3737ac2b 353 @param[out] BufferSize If not NULL, then the pointer to the size\r
354 of the allocated buffer.\r
355 @param[out] ReadOnly Upon successful return TRUE if the file is\r
356 read only. FALSE otherwise.\r
357\r
ba0014b9 358 @retval EFI_NOT_FOUND The filename did not represent a file in the\r
3737ac2b 359 file system. Directories cannot be read with\r
360 this method.\r
361 @retval EFI_SUCCESS The file was read into the buffer.\r
362 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
363 @retval EFI_LOAD_ERROR The file read operation failed.\r
364 @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
365 @retval EFI_INVALID_PARAMETER FileName was NULL.\r
366 @retval EFI_INVALID_PARAMETER FileName was a directory.\r
367**/\r
368EFI_STATUS\r
3737ac2b 369ReadFileIntoBuffer (\r
47d20b54
MK
370 IN CONST CHAR16 *FileName,\r
371 OUT VOID **Buffer,\r
372 OUT UINTN *BufferSize OPTIONAL,\r
373 OUT BOOLEAN *ReadOnly\r
3737ac2b 374 );\r
5d73d92f 375\r
3737ac2b 376#endif\r