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