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