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