]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
ShellPkg/UefiShellDebug1CommandsLib: Remove unnecessary EFIAPI
[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 GetSystemConfigurationTable (
76 IN EFI_GUID *TableGuid,
77 IN OUT VOID **Table
78 );
79
80 /**
81 Convert a string representation of a GUID to the GUID value.
82
83 @param[in] StringGuid The pointer to the string containing a GUID printed.
84 @param[in, out] Guid The pointer to the buffer to get the GUID value.
85 **/
86 EFI_STATUS
87 ConvertStringToGuid (
88 IN CONST CHAR16 *StringGuid,
89 IN OUT EFI_GUID *Guid
90 );
91
92 /**
93 Convert a Unicode character to numerical value.
94
95 This internal function only deal with Unicode character
96 which maps to a valid hexadecimal ASII character, i.e.
97 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
98 Unicode character, the value returned does not make sense.
99
100 @param Char The character to convert.
101
102 @return The numerical value converted.
103
104 **/
105 UINTN
106 HexCharToUintn (
107 IN CHAR16 Char
108 );
109
110 /**
111 Function for 'setsize' command.
112
113 @param[in] ImageHandle Handle to the Image (NULL if Internal).
114 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
115 **/
116 SHELL_STATUS
117 EFIAPI
118 ShellCommandRunSetSize (
119 IN EFI_HANDLE ImageHandle,
120 IN EFI_SYSTEM_TABLE *SystemTable
121 );
122
123 /**
124 Function for 'comp' command.
125
126 @param[in] ImageHandle Handle to the Image (NULL if Internal).
127 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
128 **/
129 SHELL_STATUS
130 EFIAPI
131 ShellCommandRunComp (
132 IN EFI_HANDLE ImageHandle,
133 IN EFI_SYSTEM_TABLE *SystemTable
134 );
135
136 /**
137 Function for 'mode' command.
138
139 @param[in] ImageHandle Handle to the Image (NULL if Internal).
140 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
141 **/
142 SHELL_STATUS
143 EFIAPI
144 ShellCommandRunMode (
145 IN EFI_HANDLE ImageHandle,
146 IN EFI_SYSTEM_TABLE *SystemTable
147 );
148
149 /**
150 Function for 'memmap' command.
151
152 @param[in] ImageHandle Handle to the Image (NULL if Internal).
153 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
154 **/
155 SHELL_STATUS
156 EFIAPI
157 ShellCommandRunMemMap (
158 IN EFI_HANDLE ImageHandle,
159 IN EFI_SYSTEM_TABLE *SystemTable
160 );
161
162 /**
163 Function for 'compress' command.
164
165 @param[in] ImageHandle Handle to the Image (NULL if Internal).
166 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
167 **/
168 SHELL_STATUS
169 EFIAPI
170 ShellCommandRunEfiCompress (
171 IN EFI_HANDLE ImageHandle,
172 IN EFI_SYSTEM_TABLE *SystemTable
173 );
174
175 /**
176 Function for 'decompress' command.
177
178 @param[in] ImageHandle Handle to the Image (NULL if Internal).
179 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
180 **/
181 SHELL_STATUS
182 EFIAPI
183 ShellCommandRunEfiDecompress (
184 IN EFI_HANDLE ImageHandle,
185 IN EFI_SYSTEM_TABLE *SystemTable
186 );
187
188 /**
189 Function for 'dmem' command.
190
191 @param[in] ImageHandle Handle to the Image (NULL if Internal).
192 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
193 **/
194 SHELL_STATUS
195 EFIAPI
196 ShellCommandRunDmem (
197 IN EFI_HANDLE ImageHandle,
198 IN EFI_SYSTEM_TABLE *SystemTable
199 );
200
201 /**
202 Function for 'loadpcirom' command.
203
204 @param[in] ImageHandle Handle to the Image (NULL if Internal).
205 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
206 **/
207 SHELL_STATUS
208 EFIAPI
209 ShellCommandRunLoadPciRom (
210 IN EFI_HANDLE ImageHandle,
211 IN EFI_SYSTEM_TABLE *SystemTable
212 );
213
214 /**
215 Function for 'mm' command.
216
217 @param[in] ImageHandle Handle to the Image (NULL if Internal).
218 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
219 **/
220 SHELL_STATUS
221 EFIAPI
222 ShellCommandRunMm (
223 IN EFI_HANDLE ImageHandle,
224 IN EFI_SYSTEM_TABLE *SystemTable
225 );
226
227 /**
228 Function for 'setvar' command.
229
230 @param[in] ImageHandle Handle to the Image (NULL if Internal).
231 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
232 **/
233 SHELL_STATUS
234 EFIAPI
235 ShellCommandRunSetVar (
236 IN EFI_HANDLE ImageHandle,
237 IN EFI_SYSTEM_TABLE *SystemTable
238 );
239
240 /**
241 Function for 'sermode' command.
242
243 @param[in] ImageHandle Handle to the Image (NULL if Internal).
244 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
245 **/
246 SHELL_STATUS
247 EFIAPI
248 ShellCommandRunSerMode (
249 IN EFI_HANDLE ImageHandle,
250 IN EFI_SYSTEM_TABLE *SystemTable
251 );
252
253 /**
254 Function for 'bcfg' command.
255
256 @param[in] ImageHandle Handle to the Image (NULL if Internal).
257 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
258 **/
259 SHELL_STATUS
260 EFIAPI
261 ShellCommandRunBcfg (
262 IN EFI_HANDLE ImageHandle,
263 IN EFI_SYSTEM_TABLE *SystemTable
264 );
265
266 /**
267 Function for 'pci' command.
268
269 @param[in] ImageHandle Handle to the Image (NULL if Internal).
270 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
271 **/
272 SHELL_STATUS
273 EFIAPI
274 ShellCommandRunPci (
275 IN EFI_HANDLE ImageHandle,
276 IN EFI_SYSTEM_TABLE *SystemTable
277 );
278
279 /**
280 Function for 'smbiosview' command.
281
282 @param[in] ImageHandle Handle to the Image (NULL if Internal).
283 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
284 **/
285 SHELL_STATUS
286 EFIAPI
287 ShellCommandRunSmbiosView (
288 IN EFI_HANDLE ImageHandle,
289 IN EFI_SYSTEM_TABLE *SystemTable
290 );
291
292 /**
293 Function for 'dmpstore' command.
294
295 @param[in] ImageHandle Handle to the Image (NULL if Internal).
296 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
297 **/
298 SHELL_STATUS
299 EFIAPI
300 ShellCommandRunDmpStore (
301 IN EFI_HANDLE ImageHandle,
302 IN EFI_SYSTEM_TABLE *SystemTable
303 );
304
305 /**
306 Function for 'dblk' command.
307
308 @param[in] ImageHandle Handle to the Image (NULL if Internal).
309 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
310 **/
311 SHELL_STATUS
312 EFIAPI
313 ShellCommandRunDblk (
314 IN EFI_HANDLE ImageHandle,
315 IN EFI_SYSTEM_TABLE *SystemTable
316 );
317
318 /**
319 Function for 'edit' command.
320
321 @param[in] ImageHandle Handle to the Image (NULL if Internal).
322 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
323 **/
324 SHELL_STATUS
325 EFIAPI
326 ShellCommandRunEdit (
327 IN EFI_HANDLE ImageHandle,
328 IN EFI_SYSTEM_TABLE *SystemTable
329 );
330
331 /**
332 Function for 'hexedit' command.
333
334 @param[in] ImageHandle Handle to the Image (NULL if Internal).
335 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
336 **/
337 SHELL_STATUS
338 EFIAPI
339 ShellCommandRunHexEdit (
340 IN EFI_HANDLE ImageHandle,
341 IN EFI_SYSTEM_TABLE *SystemTable
342 );
343
344 /**
345 Clear the line at the specified Row.
346
347 @param[in] Row The row number to be cleared ( start from 1 )
348 @param[in] LastCol The last printable column.
349 @param[in] LastRow The last printable row.
350 **/
351 VOID
352 EditorClearLine (
353 IN UINTN Row,
354 IN UINTN LastCol,
355 IN UINTN LastRow
356 );
357
358 /**
359 Check if file name has illegal characters.
360
361 @param Name The filename to check.
362
363 @retval TRUE The filename is ok.
364 @retval FALSE The filename is not ok.
365 **/
366 BOOLEAN
367 IsValidFileName (
368 IN CONST CHAR16 *Name
369 );
370
371 /**
372 Find a filename that is valid (not taken) with the given extension.
373
374 @param[in] Extension The file extension.
375
376 @retval NULL Something went wrong.
377 @return the valid filename.
378 **/
379 CHAR16 *
380 EditGetDefaultFileName (
381 IN CONST CHAR16 *Extension
382 );
383
384 /**
385 Read a file into an allocated buffer. The buffer is the responsibility
386 of the caller to free.
387
388 @param[in] FileName The filename of the file to open.
389 @param[out] Buffer Upon successful return, the pointer to the
390 address of the allocated buffer.
391 @param[out] BufferSize If not NULL, then the pointer to the size
392 of the allocated buffer.
393 @param[out] ReadOnly Upon successful return TRUE if the file is
394 read only. FALSE otherwise.
395
396 @retval EFI_NOT_FOUND The filename did not represent a file in the
397 file system. Directories cannot be read with
398 this method.
399 @retval EFI_SUCCESS The file was read into the buffer.
400 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
401 @retval EFI_LOAD_ERROR The file read operation failed.
402 @retval EFI_INVALID_PARAMETER A parameter was invalid.
403 @retval EFI_INVALID_PARAMETER FileName was NULL.
404 @retval EFI_INVALID_PARAMETER FileName was a directory.
405 **/
406 EFI_STATUS
407 ReadFileIntoBuffer (
408 IN CONST CHAR16 *FileName,
409 OUT VOID **Buffer,
410 OUT UINTN *BufferSize OPTIONAL,
411 OUT BOOLEAN *ReadOnly
412 );
413
414 #endif