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