]>
Commit | Line | Data |
---|---|---|
5d73d92f | 1 | /** @file\r |
2 | Main file for NULL named library for Profile1 shell command functions.\r | |
3 | \r | |
4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
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 | |
15 | #include <Uefi.h>\r | |
16 | #include <ShellBase.h>\r | |
17 | \r | |
18 | #include <Guid/GlobalVariable.h>\r | |
19 | #include <Guid/ConsoleInDevice.h>\r | |
20 | #include <Guid/ConsoleOutDevice.h>\r | |
21 | \r | |
22 | #include <Protocol/EfiShell.h>\r | |
23 | #include <Protocol/EfiShellParameters.h>\r | |
24 | #include <Protocol/DevicePath.h>\r | |
25 | #include <Protocol/LoadedImage.h>\r | |
26 | #include <Protocol/UnicodeCollation.h>\r | |
27 | #include <Protocol/DevicePathToText.h>\r | |
28 | #include <Protocol/DriverDiagnostics2.h>\r | |
29 | #include <Protocol/DriverDiagnostics.h>\r | |
30 | #include <Protocol/PlatformDriverOverride.h>\r | |
31 | #include <Protocol/BusSpecificDriverOverride.h>\r | |
32 | #include <Protocol/PlatformToDriverConfiguration.h>\r | |
33 | #include <Protocol/DriverSupportedEfiVersion.h>\r | |
34 | #include <Protocol/DriverFamilyOverride.h>\r | |
35 | #include <Protocol/DriverHealth.h>\r | |
36 | #include <Protocol/DevicePathFromText.h>\r | |
37 | \r | |
38 | #include <Library/BaseLib.h>\r | |
39 | #include <Library/BaseMemoryLib.h>\r | |
40 | #include <Library/DebugLib.h>\r | |
41 | #include <Library/MemoryAllocationLib.h>\r | |
42 | #include <Library/PcdLib.h>\r | |
43 | #include <Library/ShellCommandLib.h>\r | |
44 | #include <Library/ShellLib.h>\r | |
45 | #include <Library/SortLib.h>\r | |
46 | #include <Library/UefiLib.h>\r | |
47 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
48 | #include <Library/UefiBootServicesTableLib.h>\r | |
49 | #include <Library/HiiLib.h>\r | |
50 | #include <Library/FileHandleLib.h>\r | |
51 | #include <Library/DevicePathLib.h>\r | |
52 | #include <Library/PrintLib.h>\r | |
53 | #include <Library/HandleParsingLib.h>\r | |
54 | \r | |
55 | \r | |
56 | extern EFI_HANDLE gShellDebug1HiiHandle;\r | |
57 | extern CONST EFI_GUID gShellDebug1HiiGuid;\r | |
58 | \r | |
59 | /**\r | |
60 | Function printing hex output to the console.\r | |
61 | \r | |
62 | @param[in] Indent Number of spaces to indent.\r | |
63 | @param[in] Offset Offset to start with.\r | |
64 | @param[in] DataSize Length of data.\r | |
65 | @param[in] UserData Pointer to some data.\r | |
66 | **/\r | |
67 | VOID\r | |
68 | DumpHex (\r | |
69 | IN UINTN Indent,\r | |
70 | IN UINTN Offset,\r | |
71 | IN UINTN DataSize,\r | |
72 | IN VOID *UserData\r | |
73 | );\r | |
74 | \r | |
75 | /**\r | |
76 | Function returns a system configuration table that is stored in the\r | |
77 | EFI System Table based on the provided GUID.\r | |
78 | \r | |
79 | @param[in] TableGuid A pointer to the table's GUID type.\r | |
80 | @param[out] Table On exit, a pointer to a system configuration table.\r | |
81 | \r | |
82 | @retval EFI_SUCCESS A configuration table matching TableGuid was found.\r | |
83 | @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.\r | |
84 | **/\r | |
85 | EFI_STATUS\r | |
86 | EFIAPI\r | |
87 | GetSystemConfigurationTable (\r | |
88 | IN EFI_GUID *TableGuid,\r | |
89 | IN OUT VOID **Table\r | |
90 | );\r | |
91 | \r | |
92 | /**\r | |
93 | Convert a string representation of a GUID to the GUID value.\r | |
94 | \r | |
95 | @param[in] StringGuid The pointer to the string containing a GUID printed.\r | |
96 | @param[in,out] Guid The pointer to the buffer to get the GUID value.\r | |
97 | **/\r | |
98 | EFI_STATUS\r | |
99 | EFIAPI\r | |
100 | ConvertStringToGuid (\r | |
101 | IN CONST CHAR16 *StringGuid,\r | |
102 | IN OUT EFI_GUID *Guid\r | |
103 | );\r | |
104 | \r | |
105 | /**\r | |
106 | Convert a Unicode character to numerical value.\r | |
107 | \r | |
108 | This internal function only deal with Unicode character\r | |
109 | which maps to a valid hexadecimal ASII character, i.e.\r | |
110 | L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other\r | |
111 | Unicode character, the value returned does not make sense.\r | |
112 | \r | |
113 | @param Char The character to convert.\r | |
114 | \r | |
115 | @return The numerical value converted.\r | |
116 | \r | |
117 | **/\r | |
118 | UINTN\r | |
119 | EFIAPI\r | |
120 | HexCharToUintn (\r | |
121 | IN CHAR16 Char\r | |
122 | );\r | |
123 | \r | |
124 | /**\r | |
125 | Function for 'setsize' 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 | ShellCommandRunSetSize (\r | |
133 | IN EFI_HANDLE ImageHandle,\r | |
134 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
135 | );\r | |
136 | \r | |
137 | /**\r | |
138 | Function for 'comp' 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 | ShellCommandRunComp (\r | |
146 | IN EFI_HANDLE ImageHandle,\r | |
147 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
148 | );\r | |
149 | \r | |
150 | /**\r | |
151 | Function for 'mode' 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 | ShellCommandRunMode (\r | |
159 | IN EFI_HANDLE ImageHandle,\r | |
160 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
161 | );\r | |
162 | \r | |
163 | /**\r | |
164 | Function for 'memmap' 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 | ShellCommandRunMemMap (\r | |
172 | IN EFI_HANDLE ImageHandle,\r | |
173 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
174 | );\r | |
175 | \r | |
176 | /**\r | |
177 | Function for 'compress' 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 | ShellCommandRunEfiCompress (\r | |
185 | IN EFI_HANDLE ImageHandle,\r | |
186 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
187 | );\r | |
188 | \r | |
189 | /**\r | |
190 | Function for 'decompress' 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 | ShellCommandRunEfiDecompress (\r | |
198 | IN EFI_HANDLE ImageHandle,\r | |
199 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
200 | );\r | |
201 | \r | |
202 | /**\r | |
203 | Function for 'dmem' 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 | ShellCommandRunDmem (\r | |
211 | IN EFI_HANDLE ImageHandle,\r | |
212 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
213 | );\r | |
214 | \r | |
215 | /**\r | |
216 | Function for 'loadpcirom' 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 | ShellCommandRunLoadPciRom (\r | |
224 | IN EFI_HANDLE ImageHandle,\r | |
225 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
226 | );\r | |
227 | \r | |
228 | /**\r | |
229 | Function for 'mm' 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 | ShellCommandRunMm (\r | |
237 | IN EFI_HANDLE ImageHandle,\r | |
238 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
239 | );\r | |
240 | \r | |
241 | /**\r | |
242 | Function for 'setvar' 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 | ShellCommandRunSetVar (\r | |
250 | IN EFI_HANDLE ImageHandle,\r | |
251 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
252 | );\r | |
253 | \r | |
254 | /**\r | |
255 | Function for 'sermode' 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 | ShellCommandRunSerMode (\r | |
263 | IN EFI_HANDLE ImageHandle,\r | |
264 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
265 | );\r | |
266 | \r | |
267 | /**\r | |
268 | Function for 'bcfg' 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 | ShellCommandRunBcfg (\r | |
276 | IN EFI_HANDLE ImageHandle,\r | |
277 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
278 | );\r | |
279 | \r | |
280 | /**\r | |
281 | Function for 'pci' 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 | ShellCommandRunPci (\r | |
289 | IN EFI_HANDLE ImageHandle,\r | |
290 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
291 | );\r | |
292 | \r | |
293 | /**\r | |
294 | Function for 'smbiosview' 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 | ShellCommandRunSmbiosView (\r | |
302 | IN EFI_HANDLE ImageHandle,\r | |
303 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
304 | );\r | |
305 | \r | |
306 | /**\r | |
307 | Function for 'dmpstore' command.\r | |
308 | \r | |
309 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
310 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
311 | **/\r | |
312 | SHELL_STATUS\r | |
313 | EFIAPI\r | |
314 | ShellCommandRunDmpStore (\r | |
315 | IN EFI_HANDLE ImageHandle,\r | |
316 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
317 | );\r | |
318 | \r | |
319 | /**\r | |
320 | Function for 'dblk' command.\r | |
321 | \r | |
322 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
323 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
324 | **/\r | |
325 | SHELL_STATUS\r | |
326 | EFIAPI\r | |
327 | ShellCommandRunDblk (\r | |
328 | IN EFI_HANDLE ImageHandle,\r | |
329 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
330 | );\r | |
331 | \r | |
332 | \r |