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