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