]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
MdeModulePkg-DxeCore: rename CoreGetMemoryMapPropertiesTable
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / UefiShellDebug1CommandsLib.h
1 /** @file
2 Main file for NULL named library for Profile1 shell command functions.
3
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
9
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.
12
13 **/
14
15 #ifndef _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
16 #define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
17
18 #include <Uefi.h>
19 #include <ShellBase.h>
20
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>
26
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>
43
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>
60
61
62 extern EFI_HANDLE gShellDebug1HiiHandle;
63
64 /**
65 Function returns a system configuration table that is stored in the
66 EFI System Table based on the provided GUID.
67
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.
70
71 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
72 @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
73 **/
74 EFI_STATUS
75 EFIAPI
76 GetSystemConfigurationTable (
77 IN EFI_GUID *TableGuid,
78 IN OUT VOID **Table
79 );
80
81 /**
82 Convert a string representation of a GUID to the GUID value.
83
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.
86 **/
87 EFI_STATUS
88 EFIAPI
89 ConvertStringToGuid (
90 IN CONST CHAR16 *StringGuid,
91 IN OUT EFI_GUID *Guid
92 );
93
94 /**
95 Convert a Unicode character to numerical value.
96
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.
101
102 @param Char The character to convert.
103
104 @return The numerical value converted.
105
106 **/
107 UINTN
108 EFIAPI
109 HexCharToUintn (
110 IN CHAR16 Char
111 );
112
113 /**
114 Function for 'setsize' command.
115
116 @param[in] ImageHandle Handle to the Image (NULL if Internal).
117 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
118 **/
119 SHELL_STATUS
120 EFIAPI
121 ShellCommandRunSetSize (
122 IN EFI_HANDLE ImageHandle,
123 IN EFI_SYSTEM_TABLE *SystemTable
124 );
125
126 /**
127 Function for 'comp' command.
128
129 @param[in] ImageHandle Handle to the Image (NULL if Internal).
130 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
131 **/
132 SHELL_STATUS
133 EFIAPI
134 ShellCommandRunComp (
135 IN EFI_HANDLE ImageHandle,
136 IN EFI_SYSTEM_TABLE *SystemTable
137 );
138
139 /**
140 Function for 'mode' command.
141
142 @param[in] ImageHandle Handle to the Image (NULL if Internal).
143 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
144 **/
145 SHELL_STATUS
146 EFIAPI
147 ShellCommandRunMode (
148 IN EFI_HANDLE ImageHandle,
149 IN EFI_SYSTEM_TABLE *SystemTable
150 );
151
152 /**
153 Function for 'memmap' command.
154
155 @param[in] ImageHandle Handle to the Image (NULL if Internal).
156 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
157 **/
158 SHELL_STATUS
159 EFIAPI
160 ShellCommandRunMemMap (
161 IN EFI_HANDLE ImageHandle,
162 IN EFI_SYSTEM_TABLE *SystemTable
163 );
164
165 /**
166 Function for 'compress' command.
167
168 @param[in] ImageHandle Handle to the Image (NULL if Internal).
169 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
170 **/
171 SHELL_STATUS
172 EFIAPI
173 ShellCommandRunEfiCompress (
174 IN EFI_HANDLE ImageHandle,
175 IN EFI_SYSTEM_TABLE *SystemTable
176 );
177
178 /**
179 Function for 'decompress' command.
180
181 @param[in] ImageHandle Handle to the Image (NULL if Internal).
182 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
183 **/
184 SHELL_STATUS
185 EFIAPI
186 ShellCommandRunEfiDecompress (
187 IN EFI_HANDLE ImageHandle,
188 IN EFI_SYSTEM_TABLE *SystemTable
189 );
190
191 /**
192 Function for 'dmem' command.
193
194 @param[in] ImageHandle Handle to the Image (NULL if Internal).
195 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
196 **/
197 SHELL_STATUS
198 EFIAPI
199 ShellCommandRunDmem (
200 IN EFI_HANDLE ImageHandle,
201 IN EFI_SYSTEM_TABLE *SystemTable
202 );
203
204 /**
205 Function for 'loadpcirom' command.
206
207 @param[in] ImageHandle Handle to the Image (NULL if Internal).
208 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
209 **/
210 SHELL_STATUS
211 EFIAPI
212 ShellCommandRunLoadPciRom (
213 IN EFI_HANDLE ImageHandle,
214 IN EFI_SYSTEM_TABLE *SystemTable
215 );
216
217 /**
218 Function for 'mm' command.
219
220 @param[in] ImageHandle Handle to the Image (NULL if Internal).
221 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
222 **/
223 SHELL_STATUS
224 EFIAPI
225 ShellCommandRunMm (
226 IN EFI_HANDLE ImageHandle,
227 IN EFI_SYSTEM_TABLE *SystemTable
228 );
229
230 /**
231 Function for 'setvar' command.
232
233 @param[in] ImageHandle Handle to the Image (NULL if Internal).
234 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
235 **/
236 SHELL_STATUS
237 EFIAPI
238 ShellCommandRunSetVar (
239 IN EFI_HANDLE ImageHandle,
240 IN EFI_SYSTEM_TABLE *SystemTable
241 );
242
243 /**
244 Function for 'sermode' command.
245
246 @param[in] ImageHandle Handle to the Image (NULL if Internal).
247 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
248 **/
249 SHELL_STATUS
250 EFIAPI
251 ShellCommandRunSerMode (
252 IN EFI_HANDLE ImageHandle,
253 IN EFI_SYSTEM_TABLE *SystemTable
254 );
255
256 /**
257 Function for 'bcfg' command.
258
259 @param[in] ImageHandle Handle to the Image (NULL if Internal).
260 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
261 **/
262 SHELL_STATUS
263 EFIAPI
264 ShellCommandRunBcfg (
265 IN EFI_HANDLE ImageHandle,
266 IN EFI_SYSTEM_TABLE *SystemTable
267 );
268
269 /**
270 Function for 'pci' command.
271
272 @param[in] ImageHandle Handle to the Image (NULL if Internal).
273 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
274 **/
275 SHELL_STATUS
276 EFIAPI
277 ShellCommandRunPci (
278 IN EFI_HANDLE ImageHandle,
279 IN EFI_SYSTEM_TABLE *SystemTable
280 );
281
282 /**
283 Function for 'smbiosview' command.
284
285 @param[in] ImageHandle Handle to the Image (NULL if Internal).
286 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
287 **/
288 SHELL_STATUS
289 EFIAPI
290 ShellCommandRunSmbiosView (
291 IN EFI_HANDLE ImageHandle,
292 IN EFI_SYSTEM_TABLE *SystemTable
293 );
294
295 /**
296 Function for 'dmpstore' command.
297
298 @param[in] ImageHandle Handle to the Image (NULL if Internal).
299 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
300 **/
301 SHELL_STATUS
302 EFIAPI
303 ShellCommandRunDmpStore (
304 IN EFI_HANDLE ImageHandle,
305 IN EFI_SYSTEM_TABLE *SystemTable
306 );
307
308 /**
309 Function for 'dblk' command.
310
311 @param[in] ImageHandle Handle to the Image (NULL if Internal).
312 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
313 **/
314 SHELL_STATUS
315 EFIAPI
316 ShellCommandRunDblk (
317 IN EFI_HANDLE ImageHandle,
318 IN EFI_SYSTEM_TABLE *SystemTable
319 );
320
321 /**
322 Function for 'edit' command.
323
324 @param[in] ImageHandle Handle to the Image (NULL if Internal).
325 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
326 **/
327 SHELL_STATUS
328 EFIAPI
329 ShellCommandRunEdit (
330 IN EFI_HANDLE ImageHandle,
331 IN EFI_SYSTEM_TABLE *SystemTable
332 );
333
334 /**
335 Function for 'hexedit' command.
336
337 @param[in] ImageHandle Handle to the Image (NULL if Internal).
338 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
339 **/
340 SHELL_STATUS
341 EFIAPI
342 ShellCommandRunHexEdit (
343 IN EFI_HANDLE ImageHandle,
344 IN EFI_SYSTEM_TABLE *SystemTable
345 );
346
347 /**
348 Clear the line at the specified Row.
349
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.
353 **/
354 VOID
355 EFIAPI
356 EditorClearLine (
357 IN UINTN Row,
358 IN UINTN LastCol,
359 IN UINTN LastRow
360 );
361
362 /**
363 Check if file name has illegal characters.
364
365 @param Name The filename to check.
366
367 @retval TRUE The filename is ok.
368 @retval FALSE The filename is not ok.
369 **/
370 BOOLEAN
371 EFIAPI
372 IsValidFileName (
373 IN CONST CHAR16 *Name
374 );
375
376 /**
377 Find a filename that is valid (not taken) with the given extension.
378
379 @param[in] Extension The file extension.
380
381 @retval NULL Something went wrong.
382 @return the valid filename.
383 **/
384 CHAR16 *
385 EFIAPI
386 EditGetDefaultFileName (
387 IN CONST CHAR16 *Extension
388 );
389
390 /**
391 Read a file into an allocated buffer. The buffer is the responsibility
392 of the caller to free.
393
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.
401
402 @retval EFI_NOT_FOUND The filename did not represent a file in the
403 file system. Directories cannot be read with
404 this method.
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.
411 **/
412 EFI_STATUS
413 EFIAPI
414 ReadFileIntoBuffer (
415 IN CONST CHAR16 *FileName,
416 OUT VOID **Buffer,
417 OUT UINTN *BufferSize OPTIONAL,
418 OUT BOOLEAN *ReadOnly
419 );
420
421 #endif