]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Include file for basic command line parser for EBL (Embedded Boot Loader)\r | |
3 | \r | |
4 | Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r | |
5 | Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r | |
6 | (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r | |
7 | \r | |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __EBL_H__\r | |
19 | #define __EBL_H__\r | |
20 | \r | |
21 | #include <PiDxe.h>\r | |
22 | #include <Protocol/BlockIo.h>\r | |
23 | #include <Protocol/SimpleFileSystem.h>\r | |
24 | #include <Protocol/FirmwareVolume2.h>\r | |
25 | #include <Protocol/LoadFile.h>\r | |
26 | #include <Protocol/FirmwareVolumeBlock.h>\r | |
27 | #include <Protocol/PxeBaseCode.h>\r | |
28 | #include <Protocol/LoadedImage.h>\r | |
29 | #include <Protocol/EblAddCommand.h>\r | |
30 | #include <Protocol/PciIo.h>\r | |
31 | #include <Protocol/DevicePath.h>\r | |
32 | \r | |
33 | #include <Guid/FileInfo.h>\r | |
34 | #include <Guid/DxeServices.h>\r | |
35 | #include <Guid/MemoryTypeInformation.h>\r | |
36 | #include <Guid/MemoryAllocationHob.h>\r | |
37 | #include <Library/BaseLib.h>\r | |
38 | #include <Library/MemoryAllocationLib.h>\r | |
39 | #include <Library/DevicePathLib.h>\r | |
40 | #include <Library/PrintLib.h>\r | |
41 | #include <Library/BaseMemoryLib.h>\r | |
42 | #include <Library/UefiLib.h>\r | |
43 | #include <Library/UefiBootServicesTableLib.h>\r | |
44 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
45 | #include <Library/DebugLib.h>\r | |
46 | #include <Library/EfiFileLib.h>\r | |
47 | #include <Library/HobLib.h>\r | |
48 | #include <Library/DebugLib.h>\r | |
49 | #include <Library/IoLib.h>\r | |
50 | #include <Library/PcdLib.h>\r | |
51 | #include <Library/EblCmdLib.h>\r | |
52 | #include <Library/DevicePathLib.h>\r | |
53 | #include <Library/UefiLib.h>\r | |
54 | #include <Library/EblNetworkLib.h>\r | |
55 | #include <Library/TimerLib.h>\r | |
56 | \r | |
57 | #include <IndustryStandard/Pci.h>\r | |
58 | \r | |
59 | //\r | |
60 | // Prompt for the command line\r | |
61 | //\r | |
62 | #define CMD_SEPARATOR ';'\r | |
63 | #define EBL_MAX_COMMAND_COUNT 0x100\r | |
64 | #define MAX_CMD_HISTORY 16\r | |
65 | #define MAX_CMD_LINE 256\r | |
66 | #define MAX_ARGS 32\r | |
67 | \r | |
68 | #define EBL_CR 0x0a\r | |
69 | #define EBL_LF 0x0d\r | |
70 | \r | |
71 | #define EFI_SET_TIMER_TO_SECOND 10000000\r | |
72 | \r | |
73 | \r | |
74 | \r | |
75 | EBL_COMMAND_TABLE *\r | |
76 | EblGetCommand (\r | |
77 | IN CHAR8 *CommandName\r | |
78 | );\r | |
79 | \r | |
80 | \r | |
81 | EFI_STATUS\r | |
82 | EblPathToDevice (\r | |
83 | IN CHAR8 *Path,\r | |
84 | OUT EFI_HANDLE *DeviceHandle,\r | |
85 | OUT EFI_DEVICE_PATH_PROTOCOL **PathDevicePath,\r | |
86 | OUT VOID **Buffer,\r | |
87 | OUT UINTN *BufferSize\r | |
88 | );\r | |
89 | \r | |
90 | BOOLEAN\r | |
91 | EFIAPI\r | |
92 | EblAnyKeyToContinueQtoQuit (\r | |
93 | IN UINTN *CurrentRow,\r | |
94 | IN BOOLEAN PrefixNewline\r | |
95 | );\r | |
96 | \r | |
97 | VOID\r | |
98 | EblUpdateDeviceLists (\r | |
99 | VOID\r | |
100 | );\r | |
101 | \r | |
102 | VOID\r | |
103 | EblInitializeCmdTable (\r | |
104 | VOID\r | |
105 | );\r | |
106 | \r | |
107 | VOID\r | |
108 | EblShutdownExternalCmdTable (\r | |
109 | VOID\r | |
110 | );\r | |
111 | \r | |
112 | VOID\r | |
113 | EblSetTextColor (\r | |
114 | UINTN Attribute\r | |
115 | );\r | |
116 | \r | |
117 | \r | |
118 | EFI_STATUS\r | |
119 | EFIAPI\r | |
120 | EblGetCharKey (\r | |
121 | IN OUT EFI_INPUT_KEY *Key,\r | |
122 | IN UINTN TimoutInSec,\r | |
123 | IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL\r | |
124 | );\r | |
125 | \r | |
126 | // BugBug: Move me to a library\r | |
127 | INTN\r | |
128 | EFIAPI\r | |
129 | AsciiStrniCmp (\r | |
130 | IN CONST CHAR8 *FirstString,\r | |
131 | IN CONST CHAR8 *SecondString,\r | |
132 | IN UINTN Length\r | |
133 | );\r | |
134 | \r | |
135 | \r | |
136 | VOID\r | |
137 | EblInitializeDeviceCmd (\r | |
138 | VOID\r | |
139 | );\r | |
140 | \r | |
141 | VOID\r | |
142 | EblInitializemdHwDebugCmds (\r | |
143 | VOID\r | |
144 | );\r | |
145 | \r | |
146 | VOID\r | |
147 | EblInitializeDirCmd (\r | |
148 | VOID\r | |
149 | );\r | |
150 | \r | |
151 | VOID\r | |
152 | EblInitializeHobCmd (\r | |
153 | VOID\r | |
154 | );\r | |
155 | \r | |
156 | VOID\r | |
157 | EblInitializemdHwIoDebugCmds (\r | |
158 | VOID\r | |
159 | );\r | |
160 | \r | |
161 | VOID\r | |
162 | EblInitializeScriptCmd (\r | |
163 | VOID\r | |
164 | );\r | |
165 | \r | |
166 | VOID\r | |
167 | EblInitializeNetworkCmd (\r | |
168 | VOID\r | |
169 | );\r | |
170 | \r | |
171 | VOID\r | |
172 | EblInitializeVariableCmds (\r | |
173 | VOID\r | |
174 | );\r | |
175 | \r | |
176 | CHAR8 *\r | |
177 | ParseArguments (\r | |
178 | IN CHAR8 *CmdLine,\r | |
179 | OUT UINTN *Argc,\r | |
180 | OUT CHAR8 **Argv\r | |
181 | );\r | |
182 | \r | |
183 | EFI_STATUS\r | |
184 | ProcessCmdLine (\r | |
185 | IN CHAR8 *CmdLine,\r | |
186 | IN UINTN MaxCmdLineSize\r | |
187 | );\r | |
188 | \r | |
189 | EFI_STATUS\r | |
190 | OutputData (\r | |
191 | IN UINT8 *Address,\r | |
192 | IN UINTN Length,\r | |
193 | IN UINTN Width,\r | |
194 | IN UINTN Offset\r | |
195 | );\r | |
196 | \r | |
197 | UINTN\r | |
198 | WidthFromCommandName (\r | |
199 | IN CHAR8 *Argv,\r | |
200 | IN UINTN Default\r | |
201 | );\r | |
202 | \r | |
203 | \r | |
204 | extern UINTN gScreenColumns;\r | |
205 | extern UINTN gScreenRows;\r | |
206 | extern BOOLEAN gPageBreak;\r | |
207 | extern CHAR8 *gMemMapType[];\r | |
208 | \r | |
209 | #endif\r | |
210 | \r |