]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
Add "Debug1" profile (all but Edit and HexEdit commands)
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / UefiShellDebug1CommandsLib.h
1 /** @file
2 Main file for NULL named library for Profile1 shell command functions.
3
4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include <Uefi.h>
16 #include <ShellBase.h>
17
18 #include <Guid/GlobalVariable.h>
19 #include <Guid/ConsoleInDevice.h>
20 #include <Guid/ConsoleOutDevice.h>
21
22 #include <Protocol/EfiShell.h>
23 #include <Protocol/EfiShellParameters.h>
24 #include <Protocol/DevicePath.h>
25 #include <Protocol/LoadedImage.h>
26 #include <Protocol/UnicodeCollation.h>
27 #include <Protocol/DevicePathToText.h>
28 #include <Protocol/DriverDiagnostics2.h>
29 #include <Protocol/DriverDiagnostics.h>
30 #include <Protocol/PlatformDriverOverride.h>
31 #include <Protocol/BusSpecificDriverOverride.h>
32 #include <Protocol/PlatformToDriverConfiguration.h>
33 #include <Protocol/DriverSupportedEfiVersion.h>
34 #include <Protocol/DriverFamilyOverride.h>
35 #include <Protocol/DriverHealth.h>
36 #include <Protocol/DevicePathFromText.h>
37
38 #include <Library/BaseLib.h>
39 #include <Library/BaseMemoryLib.h>
40 #include <Library/DebugLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/PcdLib.h>
43 #include <Library/ShellCommandLib.h>
44 #include <Library/ShellLib.h>
45 #include <Library/SortLib.h>
46 #include <Library/UefiLib.h>
47 #include <Library/UefiRuntimeServicesTableLib.h>
48 #include <Library/UefiBootServicesTableLib.h>
49 #include <Library/HiiLib.h>
50 #include <Library/FileHandleLib.h>
51 #include <Library/DevicePathLib.h>
52 #include <Library/PrintLib.h>
53 #include <Library/HandleParsingLib.h>
54
55
56 extern EFI_HANDLE gShellDebug1HiiHandle;
57 extern CONST EFI_GUID gShellDebug1HiiGuid;
58
59 /**
60 Function printing hex output to the console.
61
62 @param[in] Indent Number of spaces to indent.
63 @param[in] Offset Offset to start with.
64 @param[in] DataSize Length of data.
65 @param[in] UserData Pointer to some data.
66 **/
67 VOID
68 DumpHex (
69 IN UINTN Indent,
70 IN UINTN Offset,
71 IN UINTN DataSize,
72 IN VOID *UserData
73 );
74
75 /**
76 Function returns a system configuration table that is stored in the
77 EFI System Table based on the provided GUID.
78
79 @param[in] TableGuid A pointer to the table's GUID type.
80 @param[out] Table On exit, a pointer to a system configuration table.
81
82 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
83 @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
84 **/
85 EFI_STATUS
86 EFIAPI
87 GetSystemConfigurationTable (
88 IN EFI_GUID *TableGuid,
89 IN OUT VOID **Table
90 );
91
92 /**
93 Convert a string representation of a GUID to the GUID value.
94
95 @param[in] StringGuid The pointer to the string containing a GUID printed.
96 @param[in,out] Guid The pointer to the buffer to get the GUID value.
97 **/
98 EFI_STATUS
99 EFIAPI
100 ConvertStringToGuid (
101 IN CONST CHAR16 *StringGuid,
102 IN OUT EFI_GUID *Guid
103 );
104
105 /**
106 Convert a Unicode character to numerical value.
107
108 This internal function only deal with Unicode character
109 which maps to a valid hexadecimal ASII character, i.e.
110 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
111 Unicode character, the value returned does not make sense.
112
113 @param Char The character to convert.
114
115 @return The numerical value converted.
116
117 **/
118 UINTN
119 EFIAPI
120 HexCharToUintn (
121 IN CHAR16 Char
122 );
123
124 /**
125 Function for 'setsize' command.
126
127 @param[in] ImageHandle Handle to the Image (NULL if Internal).
128 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
129 **/
130 SHELL_STATUS
131 EFIAPI
132 ShellCommandRunSetSize (
133 IN EFI_HANDLE ImageHandle,
134 IN EFI_SYSTEM_TABLE *SystemTable
135 );
136
137 /**
138 Function for 'comp' command.
139
140 @param[in] ImageHandle Handle to the Image (NULL if Internal).
141 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
142 **/
143 SHELL_STATUS
144 EFIAPI
145 ShellCommandRunComp (
146 IN EFI_HANDLE ImageHandle,
147 IN EFI_SYSTEM_TABLE *SystemTable
148 );
149
150 /**
151 Function for 'mode' command.
152
153 @param[in] ImageHandle Handle to the Image (NULL if Internal).
154 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
155 **/
156 SHELL_STATUS
157 EFIAPI
158 ShellCommandRunMode (
159 IN EFI_HANDLE ImageHandle,
160 IN EFI_SYSTEM_TABLE *SystemTable
161 );
162
163 /**
164 Function for 'memmap' command.
165
166 @param[in] ImageHandle Handle to the Image (NULL if Internal).
167 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
168 **/
169 SHELL_STATUS
170 EFIAPI
171 ShellCommandRunMemMap (
172 IN EFI_HANDLE ImageHandle,
173 IN EFI_SYSTEM_TABLE *SystemTable
174 );
175
176 /**
177 Function for 'compress' command.
178
179 @param[in] ImageHandle Handle to the Image (NULL if Internal).
180 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
181 **/
182 SHELL_STATUS
183 EFIAPI
184 ShellCommandRunEfiCompress (
185 IN EFI_HANDLE ImageHandle,
186 IN EFI_SYSTEM_TABLE *SystemTable
187 );
188
189 /**
190 Function for 'decompress' command.
191
192 @param[in] ImageHandle Handle to the Image (NULL if Internal).
193 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
194 **/
195 SHELL_STATUS
196 EFIAPI
197 ShellCommandRunEfiDecompress (
198 IN EFI_HANDLE ImageHandle,
199 IN EFI_SYSTEM_TABLE *SystemTable
200 );
201
202 /**
203 Function for 'dmem' command.
204
205 @param[in] ImageHandle Handle to the Image (NULL if Internal).
206 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
207 **/
208 SHELL_STATUS
209 EFIAPI
210 ShellCommandRunDmem (
211 IN EFI_HANDLE ImageHandle,
212 IN EFI_SYSTEM_TABLE *SystemTable
213 );
214
215 /**
216 Function for 'loadpcirom' command.
217
218 @param[in] ImageHandle Handle to the Image (NULL if Internal).
219 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
220 **/
221 SHELL_STATUS
222 EFIAPI
223 ShellCommandRunLoadPciRom (
224 IN EFI_HANDLE ImageHandle,
225 IN EFI_SYSTEM_TABLE *SystemTable
226 );
227
228 /**
229 Function for 'mm' command.
230
231 @param[in] ImageHandle Handle to the Image (NULL if Internal).
232 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
233 **/
234 SHELL_STATUS
235 EFIAPI
236 ShellCommandRunMm (
237 IN EFI_HANDLE ImageHandle,
238 IN EFI_SYSTEM_TABLE *SystemTable
239 );
240
241 /**
242 Function for 'setvar' command.
243
244 @param[in] ImageHandle Handle to the Image (NULL if Internal).
245 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
246 **/
247 SHELL_STATUS
248 EFIAPI
249 ShellCommandRunSetVar (
250 IN EFI_HANDLE ImageHandle,
251 IN EFI_SYSTEM_TABLE *SystemTable
252 );
253
254 /**
255 Function for 'sermode' command.
256
257 @param[in] ImageHandle Handle to the Image (NULL if Internal).
258 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
259 **/
260 SHELL_STATUS
261 EFIAPI
262 ShellCommandRunSerMode (
263 IN EFI_HANDLE ImageHandle,
264 IN EFI_SYSTEM_TABLE *SystemTable
265 );
266
267 /**
268 Function for 'bcfg' command.
269
270 @param[in] ImageHandle Handle to the Image (NULL if Internal).
271 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
272 **/
273 SHELL_STATUS
274 EFIAPI
275 ShellCommandRunBcfg (
276 IN EFI_HANDLE ImageHandle,
277 IN EFI_SYSTEM_TABLE *SystemTable
278 );
279
280 /**
281 Function for 'pci' command.
282
283 @param[in] ImageHandle Handle to the Image (NULL if Internal).
284 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
285 **/
286 SHELL_STATUS
287 EFIAPI
288 ShellCommandRunPci (
289 IN EFI_HANDLE ImageHandle,
290 IN EFI_SYSTEM_TABLE *SystemTable
291 );
292
293 /**
294 Function for 'smbiosview' command.
295
296 @param[in] ImageHandle Handle to the Image (NULL if Internal).
297 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
298 **/
299 SHELL_STATUS
300 EFIAPI
301 ShellCommandRunSmbiosView (
302 IN EFI_HANDLE ImageHandle,
303 IN EFI_SYSTEM_TABLE *SystemTable
304 );
305
306 /**
307 Function for 'dmpstore' command.
308
309 @param[in] ImageHandle Handle to the Image (NULL if Internal).
310 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
311 **/
312 SHELL_STATUS
313 EFIAPI
314 ShellCommandRunDmpStore (
315 IN EFI_HANDLE ImageHandle,
316 IN EFI_SYSTEM_TABLE *SystemTable
317 );
318
319 /**
320 Function for 'dblk' command.
321
322 @param[in] ImageHandle Handle to the Image (NULL if Internal).
323 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
324 **/
325 SHELL_STATUS
326 EFIAPI
327 ShellCommandRunDblk (
328 IN EFI_HANDLE ImageHandle,
329 IN EFI_SYSTEM_TABLE *SystemTable
330 );
331
332