]>
Commit | Line | Data |
---|---|---|
fd6a62f3 | 1 | /** @file\r |
2 | Header file for boot maintenance module.\r | |
93e3992d | 3 | \r |
fd6a62f3 | 4 | Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r |
93e3992d | 5 | All rights reserved. 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 | |
fd6a62f3 | 13 | **/\r |
93e3992d | 14 | \r |
15 | #ifndef _BOOT_MAINT_H\r | |
16 | #define _BOOT_MAINT_H\r | |
17 | \r | |
18 | #include "Bds.h"\r | |
19 | #include "BBSsupport.h"\r | |
20 | #include "FormGuid.h"\r | |
21 | #include "FrontPage.h"\r | |
22 | \r | |
23 | //\r | |
24 | // Constants which are variable names used to access variables\r | |
25 | //\r | |
26 | #define VarLegacyDevOrder L"LegacyDevOrder"\r | |
27 | \r | |
28 | #define VarConOutMode L"ConOutMode"\r | |
29 | \r | |
30 | //\r | |
31 | // Guid of a NV Variable which store the information about the\r | |
32 | // FD/HD/CD/NET/BEV order\r | |
33 | //\r | |
34 | #define EFI_LEGACY_DEV_ORDER_VARIABLE_GUID \\r | |
35 | { \\r | |
36 | 0xa56074db, 0x65fe, 0x45f7, {0xbd, 0x21, 0x2d, 0x2b, 0xdd, 0x8e, 0x96, 0x52} \\r | |
37 | }\r | |
38 | \r | |
39 | //\r | |
40 | // String Contant\r | |
41 | //\r | |
42 | #define StrFloppy L"Floppy Drive #%02x"\r | |
43 | #define StrHardDisk L"HardDisk Drive #%02x"\r | |
44 | #define StrCDROM L"ATAPI CDROM Drive #%02x"\r | |
45 | #define StrNET L"NET Drive #%02x"\r | |
46 | #define StrBEV L"BEV Drive #%02x"\r | |
47 | #define StrFloppyHelp L"Select Floppy Drive #%02x"\r | |
48 | #define StrHardDiskHelp L"Select HardDisk Drive #%02x"\r | |
49 | #define StrCDROMHelp L"Select ATAPI CDROM Drive #%02x"\r | |
50 | #define StrNETHelp L"NET Drive #%02x"\r | |
51 | #define StrBEVHelp L"BEV Drive #%02x"\r | |
52 | \r | |
53 | //\r | |
54 | // Variable created with this flag will be "Efi:...."\r | |
55 | //\r | |
56 | #define VAR_FLAG EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE\r | |
57 | \r | |
58 | //\r | |
59 | // Define Maxmim characters that will be accepted\r | |
60 | //\r | |
61 | #define MAX_CHAR 480\r | |
62 | #define MAX_CHAR_SIZE (MAX_CHAR * 2)\r | |
63 | \r | |
64 | //\r | |
65 | // Check to see if current build support option active feature of\r | |
66 | // some driver option\r | |
67 | //\r | |
68 | #ifndef LOAD_OPTION_ACTIVE\r | |
69 | #define LOAD_OPTION_ACTIVE 0x00000001\r | |
70 | #endif\r | |
71 | \r | |
72 | //\r | |
73 | // Check to see if current build support force reconnect feature of\r | |
74 | // some driver option\r | |
75 | //\r | |
76 | #ifndef LOAD_OPTION_FORCE_RECONNECT\r | |
77 | #define LOAD_OPTION_FORCE_RECONNECT 0x00000002\r | |
78 | #endif\r | |
79 | \r | |
80 | extern EFI_GUID mBootMaintGuid;\r | |
81 | extern EFI_GUID mFileExplorerGuid;\r | |
82 | \r | |
83 | //\r | |
84 | // These are the VFR compiler generated data representing our VFR data.\r | |
85 | //\r | |
86 | extern UINT8 BmBin[];\r | |
87 | extern UINT8 FEBin[];\r | |
88 | \r | |
89 | //\r | |
90 | // Below are the number of options in Baudrate, Databits,\r | |
91 | // Parity and Stopbits selection for serial ports.\r | |
92 | //\r | |
93 | #define BM_COM_ATTR_BUADRATE 19\r | |
94 | #define BM_COM_ATTR_DATABITS 4\r | |
95 | #define BM_COM_ATTR_PARITY 5\r | |
96 | #define BM_COM_ATTR_STOPBITS 3\r | |
97 | \r | |
98 | //\r | |
99 | // Callback function helper\r | |
100 | //\r | |
101 | #define BMM_CALLBACK_DATA_SIGNATURE EFI_SIGNATURE_32 ('C', 'b', 'c', 'k')\r | |
102 | #define BMM_CALLBACK_DATA_FROM_THIS(a) CR (a, BMM_CALLBACK_DATA, BmmConfigAccess, BMM_CALLBACK_DATA_SIGNATURE)\r | |
103 | \r | |
104 | #define FE_CALLBACK_DATA_FROM_THIS(a) CR (a, BMM_CALLBACK_DATA, FeConfigAccess, BMM_CALLBACK_DATA_SIGNATURE)\r | |
105 | \r | |
106 | //\r | |
107 | // Enumeration type definition\r | |
108 | //\r | |
109 | typedef UINT8 BBS_TYPE;\r | |
110 | \r | |
111 | typedef enum {\r | |
112 | PC_ANSI = 0,\r | |
113 | VT_100,\r | |
114 | VT_100_PLUS,\r | |
115 | VT_UTF8\r | |
116 | } TYPE_OF_TERMINAL;\r | |
117 | \r | |
118 | typedef enum {\r | |
119 | COM1 = 0,\r | |
120 | COM2,\r | |
121 | UNKNOW_COM\r | |
122 | } TYPE_OF_COM;\r | |
123 | \r | |
124 | typedef enum {\r | |
125 | CONIN = 0,\r | |
126 | CONOUT,\r | |
127 | CONERR,\r | |
128 | UNKNOWN_CON\r | |
129 | } TYPE_OF_CON;\r | |
130 | \r | |
131 | typedef enum {\r | |
132 | BAUDRATE = 0,\r | |
133 | DATABITS,\r | |
134 | PARITY,\r | |
135 | STOPBITS,\r | |
136 | UNKNOW_ATTR\r | |
137 | } TYPE_OF_ATTRIBUTE;\r | |
138 | \r | |
139 | typedef enum {\r | |
140 | MANNER_GOTO = 0,\r | |
141 | MANNER_CHECK,\r | |
142 | MANNER_ONEOF,\r | |
143 | MANNER_USER_DEFINE\r | |
144 | } TYPE_OF_UPATE_MANNER;\r | |
145 | \r | |
146 | typedef enum {\r | |
147 | INACTIVE_STATE = 0,\r | |
148 | BOOT_FROM_FILE_STATE,\r | |
149 | ADD_BOOT_OPTION_STATE,\r | |
150 | ADD_DRIVER_OPTION_STATE,\r | |
151 | UNKNOWN_STATE\r | |
152 | } FILE_EXPLORER_STATE;\r | |
153 | \r | |
154 | typedef enum {\r | |
155 | FILE_SYSTEM,\r | |
156 | DIRECTORY,\r | |
157 | UNKNOWN_CONTEXT\r | |
158 | } FILE_EXPLORER_DISPLAY_CONTEXT;\r | |
159 | \r | |
160 | //\r | |
161 | // All of the signatures that will be used in list structure\r | |
162 | //\r | |
5bd4f5fa | 163 | #define BM_MENU_OPTION_SIGNATURE EFI_SIGNATURE_32 ('m', 'e', 'n', 'u')\r |
164 | #define BM_LOAD_OPTION_SIGNATURE EFI_SIGNATURE_32 ('l', 'o', 'a', 'd')\r | |
165 | #define BM_CONSOLE_OPTION_SIGNATURE EFI_SIGNATURE_32 ('c', 'n', 's', 'l')\r | |
166 | #define BM_FILE_OPTION_SIGNATURE EFI_SIGNATURE_32 ('f', 'i', 'l', 'e')\r | |
167 | #define BM_HANDLE_OPTION_SIGNATURE EFI_SIGNATURE_32 ('h', 'n', 'd', 'l')\r | |
168 | #define BM_TERMINAL_OPTION_SIGNATURE EFI_SIGNATURE_32 ('t', 'r', 'm', 'l')\r | |
169 | #define BM_MENU_ENTRY_SIGNATURE EFI_SIGNATURE_32 ('e', 'n', 't', 'r')\r | |
93e3992d | 170 | \r |
171 | #define BM_LOAD_CONTEXT_SELECT 0x0\r | |
172 | #define BM_CONSOLE_CONTEXT_SELECT 0x1\r | |
173 | #define BM_FILE_CONTEXT_SELECT 0x2\r | |
174 | #define BM_HANDLE_CONTEXT_SELECT 0x3\r | |
175 | #define BM_TERMINAL_CONTEXT_SELECT 0x5\r | |
176 | \r | |
177 | #define BM_CONSOLE_IN_CONTEXT_SELECT 0x6\r | |
178 | #define BM_CONSOLE_OUT_CONTEXT_SELECT 0x7\r | |
179 | #define BM_CONSOLE_ERR_CONTEXT_SELECT 0x8\r | |
180 | #define BM_LEGACY_DEV_CONTEXT_SELECT 0x9\r | |
181 | \r | |
182 | //\r | |
183 | // Buffer size for update data\r | |
184 | //\r | |
185 | #define UPDATE_DATA_SIZE 0x100000\r | |
186 | \r | |
187 | //\r | |
188 | // Namespace of callback keys used in display and file system navigation\r | |
189 | //\r | |
190 | #define MAX_BBS_OFFSET 0xE000\r | |
191 | #define NET_OPTION_OFFSET 0xD800\r | |
192 | #define BEV_OPTION_OFFSET 0xD000\r | |
193 | #define FD_OPTION_OFFSET 0xC000\r | |
194 | #define HD_OPTION_OFFSET 0xB000\r | |
195 | #define CD_OPTION_OFFSET 0xA000\r | |
196 | #define FILE_OPTION_OFFSET 0x8000\r | |
197 | #define FILE_OPTION_MASK 0x7FFF\r | |
198 | #define HANDLE_OPTION_OFFSET 0x7000\r | |
199 | #define CONSOLE_OPTION_OFFSET 0x6000\r | |
200 | #define TERMINAL_OPTION_OFFSET 0x5000\r | |
201 | #define CONFIG_OPTION_OFFSET 0x1200\r | |
202 | #define KEY_VALUE_OFFSET 0x1100\r | |
203 | #define FORM_ID_OFFSET 0x1000\r | |
204 | \r | |
205 | //\r | |
206 | // VarOffset that will be used to create question\r | |
207 | // all these values are computed from the structure\r | |
208 | // defined below\r | |
209 | //\r | |
210 | #define VAR_OFFSET(Field) ((UINT16) ((UINTN) &(((BMM_FAKE_NV_DATA *) 0)->Field)))\r | |
211 | \r | |
212 | //\r | |
213 | // Question Id of Zero is invalid, so add an offset to it\r | |
214 | //\r | |
215 | #define QUESTION_ID(Field) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET)\r | |
216 | \r | |
217 | #define BOOT_TIME_OUT_VAR_OFFSET VAR_OFFSET (BootTimeOut)\r | |
218 | #define BOOT_NEXT_VAR_OFFSET VAR_OFFSET (BootNext)\r | |
219 | #define COM1_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COM1BaudRate)\r | |
220 | #define COM1_DATA_RATE_VAR_OFFSET VAR_OFFSET (COM1DataRate)\r | |
221 | #define COM1_STOP_BITS_VAR_OFFSET VAR_OFFSET (COM1StopBits)\r | |
222 | #define COM1_PARITY_VAR_OFFSET VAR_OFFSET (COM1Parity)\r | |
223 | #define COM1_TERMINAL_VAR_OFFSET VAR_OFFSET (COM2TerminalType)\r | |
224 | #define COM2_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COM2BaudRate)\r | |
225 | #define COM2_DATA_RATE_VAR_OFFSET VAR_OFFSET (COM2DataRate)\r | |
226 | #define COM2_STOP_BITS_VAR_OFFSET VAR_OFFSET (COM2StopBits)\r | |
227 | #define COM2_PARITY_VAR_OFFSET VAR_OFFSET (COM2Parity)\r | |
228 | #define COM2_TERMINAL_VAR_OFFSET VAR_OFFSET (COM2TerminalType)\r | |
229 | #define DRV_ADD_HANDLE_DESC_VAR_OFFSET VAR_OFFSET (DriverAddHandleDesc)\r | |
230 | #define DRV_ADD_ACTIVE_VAR_OFFSET VAR_OFFSET (DriverAddActive)\r | |
231 | #define DRV_ADD_RECON_VAR_OFFSET VAR_OFFSET (DriverAddForceReconnect)\r | |
232 | #define CON_IN_COM1_VAR_OFFSET VAR_OFFSET (ConsoleInputCOM1)\r | |
233 | #define CON_IN_COM2_VAR_OFFSET VAR_OFFSET (ConsoleInputCOM2)\r | |
234 | #define CON_OUT_COM1_VAR_OFFSET VAR_OFFSET (ConsoleOutputCOM1)\r | |
235 | #define CON_OUT_COM2_VAR_OFFSET VAR_OFFSET (ConsoleOutputCOM2)\r | |
236 | #define CON_ERR_COM1_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM1)\r | |
237 | #define CON_ERR_COM2_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM2)\r | |
238 | #define CON_MODE_VAR_OFFSET VAR_OFFSET (ConsoleOutMode)\r | |
239 | #define CON_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleCheck)\r | |
240 | #define OPTION_ORDER_VAR_OFFSET VAR_OFFSET (OptionOrder)\r | |
241 | #define DRIVER_OPTION_ORDER_VAR_OFFSET VAR_OFFSET (DriverOptionToBeDeleted)\r | |
242 | #define BOOT_OPTION_DEL_VAR_OFFSET VAR_OFFSET (BootOptionDel)\r | |
243 | #define DRIVER_OPTION_DEL_VAR_OFFSET VAR_OFFSET (DriverOptionDel)\r | |
244 | #define DRIVER_ADD_OPTION_VAR_OFFSET VAR_OFFSET (DriverAddHandleOptionalData)\r | |
245 | #define COM_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COMBaudRate)\r | |
246 | #define COM_DATA_RATE_VAR_OFFSET VAR_OFFSET (COMDataRate)\r | |
247 | #define COM_STOP_BITS_VAR_OFFSET VAR_OFFSET (COMStopBits)\r | |
248 | #define COM_PARITY_VAR_OFFSET VAR_OFFSET (COMParity)\r | |
249 | #define COM_TERMINAL_VAR_OFFSET VAR_OFFSET (COMTerminalType)\r | |
250 | #define LEGACY_FD_VAR_OFFSET VAR_OFFSET (LegacyFD)\r | |
251 | #define LEGACY_HD_VAR_OFFSET VAR_OFFSET (LegacyHD)\r | |
252 | #define LEGACY_CD_VAR_OFFSET VAR_OFFSET (LegacyCD)\r | |
253 | #define LEGACY_NET_VAR_OFFSET VAR_OFFSET (LegacyNET)\r | |
254 | #define LEGACY_BEV_VAR_OFFSET VAR_OFFSET (LegacyBEV)\r | |
255 | \r | |
256 | #define BOOT_TIME_OUT_QUESTION_ID QUESTION_ID (BootTimeOut)\r | |
257 | #define BOOT_NEXT_QUESTION_ID QUESTION_ID (BootNext)\r | |
258 | #define COM1_BAUD_RATE_QUESTION_ID QUESTION_ID (COM1BaudRate)\r | |
259 | #define COM1_DATA_RATE_QUESTION_ID QUESTION_ID (COM1DataRate)\r | |
260 | #define COM1_STOP_BITS_QUESTION_ID QUESTION_ID (COM1StopBits)\r | |
261 | #define COM1_PARITY_QUESTION_ID QUESTION_ID (COM1Parity)\r | |
262 | #define COM1_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)\r | |
263 | #define COM2_BAUD_RATE_QUESTION_ID QUESTION_ID (COM2BaudRate)\r | |
264 | #define COM2_DATA_RATE_QUESTION_ID QUESTION_ID (COM2DataRate)\r | |
265 | #define COM2_STOP_BITS_QUESTION_ID QUESTION_ID (COM2StopBits)\r | |
266 | #define COM2_PARITY_QUESTION_ID QUESTION_ID (COM2Parity)\r | |
267 | #define COM2_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)\r | |
268 | #define DRV_ADD_HANDLE_DESC_QUESTION_ID QUESTION_ID (DriverAddHandleDesc)\r | |
269 | #define DRV_ADD_ACTIVE_QUESTION_ID QUESTION_ID (DriverAddActive)\r | |
270 | #define DRV_ADD_RECON_QUESTION_ID QUESTION_ID (DriverAddForceReconnect)\r | |
271 | #define CON_IN_COM1_QUESTION_ID QUESTION_ID (ConsoleInputCOM1)\r | |
272 | #define CON_IN_COM2_QUESTION_ID QUESTION_ID (ConsoleInputCOM2)\r | |
273 | #define CON_OUT_COM1_QUESTION_ID QUESTION_ID (ConsoleOutputCOM1)\r | |
274 | #define CON_OUT_COM2_QUESTION_ID QUESTION_ID (ConsoleOutputCOM2)\r | |
275 | #define CON_ERR_COM1_QUESTION_ID QUESTION_ID (ConsoleErrorCOM1)\r | |
276 | #define CON_ERR_COM2_QUESTION_ID QUESTION_ID (ConsoleErrorCOM2)\r | |
277 | #define CON_MODE_QUESTION_ID QUESTION_ID (ConsoleOutMode)\r | |
278 | #define CON_DEVICE_QUESTION_ID QUESTION_ID (ConsoleCheck)\r | |
279 | #define OPTION_ORDER_QUESTION_ID QUESTION_ID (OptionOrder)\r | |
280 | #define DRIVER_OPTION_ORDER_QUESTION_ID QUESTION_ID (DriverOptionToBeDeleted)\r | |
281 | #define BOOT_OPTION_DEL_QUESTION_ID QUESTION_ID (BootOptionDel)\r | |
282 | #define DRIVER_OPTION_DEL_QUESTION_ID QUESTION_ID (DriverOptionDel)\r | |
283 | #define DRIVER_ADD_OPTION_QUESTION_ID QUESTION_ID (DriverAddHandleOptionalData)\r | |
284 | #define COM_BAUD_RATE_QUESTION_ID QUESTION_ID (COMBaudRate)\r | |
285 | #define COM_DATA_RATE_QUESTION_ID QUESTION_ID (COMDataRate)\r | |
286 | #define COM_STOP_BITS_QUESTION_ID QUESTION_ID (COMStopBits)\r | |
287 | #define COM_PARITY_QUESTION_ID QUESTION_ID (COMParity)\r | |
288 | #define COM_TERMINAL_QUESTION_ID QUESTION_ID (COMTerminalType)\r | |
289 | #define LEGACY_FD_QUESTION_ID QUESTION_ID (LegacyFD)\r | |
290 | #define LEGACY_HD_QUESTION_ID QUESTION_ID (LegacyHD)\r | |
291 | #define LEGACY_CD_QUESTION_ID QUESTION_ID (LegacyCD)\r | |
292 | #define LEGACY_NET_QUESTION_ID QUESTION_ID (LegacyNET)\r | |
293 | #define LEGACY_BEV_QUESTION_ID QUESTION_ID (LegacyBEV)\r | |
294 | \r | |
295 | #define STRING_DEPOSITORY_NUMBER 8\r | |
296 | \r | |
297 | //\r | |
298 | // #pragma pack(1)\r | |
299 | //\r | |
300 | // Serial Ports attributes, first one is the value for\r | |
301 | // return from callback function, stringtoken is used to\r | |
302 | // display the value properly\r | |
303 | //\r | |
304 | typedef struct {\r | |
305 | UINTN Value;\r | |
306 | UINT16 StringToken;\r | |
307 | } COM_ATTR;\r | |
308 | \r | |
9b8a6c2e | 309 | #pragma pack(1)\r |
93e3992d | 310 | typedef struct {\r |
311 | BBS_TYPE BbsType;\r | |
312 | //\r | |
313 | // Length = sizeof (UINT16) + SIZEOF (Data)\r | |
314 | //\r | |
315 | UINT16 Length;\r | |
316 | UINT16 *Data;\r | |
317 | } BM_LEGACY_DEV_ORDER_CONTEXT;\r | |
9b8a6c2e | 318 | #pragma pack()\r |
93e3992d | 319 | \r |
320 | typedef struct {\r | |
321 | UINT64 BaudRate;\r | |
322 | UINT8 DataBits;\r | |
323 | UINT8 Parity;\r | |
324 | UINT8 StopBits;\r | |
325 | \r | |
326 | UINT8 BaudRateIndex;\r | |
327 | UINT8 DataBitsIndex;\r | |
328 | UINT8 ParityIndex;\r | |
329 | UINT8 StopBitsIndex;\r | |
330 | \r | |
331 | UINT8 IsConIn;\r | |
332 | UINT8 IsConOut;\r | |
333 | UINT8 IsStdErr;\r | |
334 | UINT8 TerminalType;\r | |
335 | \r | |
336 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
337 | } BM_TERMINAL_CONTEXT;\r | |
338 | \r | |
339 | typedef struct {\r | |
340 | BOOLEAN IsBootNext;\r | |
341 | BOOLEAN LoadOptionModified;\r | |
342 | BOOLEAN Deleted;\r | |
343 | \r | |
344 | BOOLEAN IsLegacy;\r | |
345 | BOOLEAN IsActive;\r | |
346 | BOOLEAN ForceReconnect;\r | |
347 | UINTN OptionalDataSize;\r | |
348 | \r | |
349 | UINTN LoadOptionSize;\r | |
350 | UINT8 *LoadOption;\r | |
351 | \r | |
352 | UINT32 Attributes;\r | |
353 | UINT16 FilePathListLength;\r | |
354 | UINT16 *Description;\r | |
355 | EFI_DEVICE_PATH_PROTOCOL *FilePathList;\r | |
356 | UINT8 *OptionalData;\r | |
357 | \r | |
358 | UINT16 BbsIndex;\r | |
359 | } BM_LOAD_CONTEXT;\r | |
360 | \r | |
361 | typedef struct {\r | |
362 | BBS_TABLE *BbsTable;\r | |
363 | UINTN Index;\r | |
364 | UINTN BbsCount;\r | |
365 | UINT16 *Description;\r | |
366 | } BM_LEGACY_DEVICE_CONTEXT;\r | |
367 | \r | |
368 | typedef struct {\r | |
369 | \r | |
370 | BOOLEAN IsActive;\r | |
371 | \r | |
372 | BOOLEAN IsTerminal;\r | |
373 | \r | |
374 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
375 | } BM_CONSOLE_CONTEXT;\r | |
376 | \r | |
377 | typedef struct {\r | |
378 | UINTN Column;\r | |
379 | UINTN Row;\r | |
380 | } CONSOLE_OUT_MODE;\r | |
381 | \r | |
382 | typedef struct {\r | |
383 | EFI_HANDLE Handle;\r | |
384 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
385 | EFI_FILE_HANDLE FHandle;\r | |
386 | UINT16 *FileName;\r | |
387 | EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *Info;\r | |
388 | \r | |
389 | BOOLEAN IsRoot;\r | |
390 | BOOLEAN IsDir;\r | |
391 | BOOLEAN IsRemovableMedia;\r | |
392 | BOOLEAN IsLoadFile;\r | |
393 | BOOLEAN IsBootLegacy;\r | |
394 | } BM_FILE_CONTEXT;\r | |
395 | \r | |
396 | typedef struct {\r | |
397 | EFI_HANDLE Handle;\r | |
398 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
399 | } BM_HANDLE_CONTEXT;\r | |
400 | \r | |
401 | typedef struct {\r | |
402 | UINTN Signature;\r | |
403 | LIST_ENTRY Head;\r | |
404 | UINTN MenuNumber;\r | |
405 | } BM_MENU_OPTION;\r | |
406 | \r | |
407 | typedef struct {\r | |
408 | UINTN Signature;\r | |
409 | LIST_ENTRY Link;\r | |
410 | UINTN OptionNumber;\r | |
411 | UINT16 *DisplayString;\r | |
412 | UINT16 *HelpString;\r | |
413 | EFI_STRING_ID DisplayStringToken;\r | |
414 | EFI_STRING_ID HelpStringToken;\r | |
415 | UINTN ContextSelection;\r | |
416 | VOID *VariableContext;\r | |
417 | } BM_MENU_ENTRY;\r | |
418 | \r | |
419 | typedef struct {\r | |
420 | //\r | |
421 | // Shared callback data.\r | |
422 | //\r | |
423 | UINTN Signature;\r | |
424 | \r | |
425 | BM_MENU_ENTRY *MenuEntry;\r | |
426 | BM_HANDLE_CONTEXT *HandleContext;\r | |
427 | BM_FILE_CONTEXT *FileContext;\r | |
428 | BM_LOAD_CONTEXT *LoadContext;\r | |
429 | BM_TERMINAL_CONTEXT *TerminalContext;\r | |
430 | UINTN CurrentTerminal;\r | |
9b8a6c2e | 431 | BBS_TYPE BbsType;\r |
93e3992d | 432 | \r |
433 | //\r | |
434 | // BMM main formset callback data.\r | |
435 | //\r | |
436 | EFI_HII_HANDLE BmmHiiHandle;\r | |
437 | EFI_HANDLE BmmDriverHandle;\r | |
438 | EFI_HII_CONFIG_ACCESS_PROTOCOL BmmConfigAccess;\r | |
439 | EFI_FORM_ID BmmCurrentPageId;\r | |
440 | EFI_FORM_ID BmmPreviousPageId;\r | |
441 | BOOLEAN BmmAskSaveOrNot;\r | |
442 | BMM_FAKE_NV_DATA BmmFakeNvData;\r | |
443 | BMM_FAKE_NV_DATA BmmOldFakeNVData;\r | |
444 | \r | |
445 | //\r | |
446 | // File explorer formset callback data.\r | |
447 | //\r | |
448 | EFI_HII_HANDLE FeHiiHandle;\r | |
449 | EFI_HANDLE FeDriverHandle;\r | |
450 | EFI_HII_CONFIG_ACCESS_PROTOCOL FeConfigAccess;\r | |
451 | FILE_EXPLORER_STATE FeCurrentState;\r | |
452 | FILE_EXPLORER_DISPLAY_CONTEXT FeDisplayContext;\r | |
453 | FILE_EXPLORER_NV_DATA FeFakeNvData;\r | |
454 | } BMM_CALLBACK_DATA;\r | |
455 | \r | |
456 | typedef struct _STRING_LIST_NODE {\r | |
457 | EFI_STRING_ID StringToken;\r | |
458 | struct _STRING_LIST_NODE *Next;\r | |
459 | } STRING_LIST_NODE;\r | |
460 | \r | |
461 | typedef struct _STRING_DEPOSITORY {\r | |
462 | UINTN TotalNodeNumber;\r | |
463 | STRING_LIST_NODE *CurrentNode;\r | |
464 | STRING_LIST_NODE *ListHead;\r | |
465 | } STRING_DEPOSITORY;\r | |
466 | \r | |
467 | //\r | |
468 | // #pragma pack()\r | |
469 | //\r | |
470 | // For initializing File System menu\r | |
471 | //\r | |
dce655e8 | 472 | \r |
b30312ba | 473 | /**\r |
dce655e8 | 474 | This function build the FsOptionMenu list which records all\r |
475 | available file system in the system. They includes all instances\r | |
476 | of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, all instances of EFI_LOAD_FILE_SYSTEM\r | |
477 | and all type of legacy boot device.\r | |
b30312ba | 478 | \r |
dce655e8 | 479 | @param CallbackData BMM context data\r |
b30312ba | 480 | \r |
dce655e8 | 481 | @retval EFI_SUCCESS Success find the file system\r |
482 | @retval EFI_OUT_OF_RESOURCES Can not create menu entry\r | |
b30312ba | 483 | \r |
484 | **/\r | |
93e3992d | 485 | EFI_STATUS\r |
486 | BOpt_FindFileSystem (\r | |
487 | IN BMM_CALLBACK_DATA *CallbackData\r | |
488 | )\r | |
489 | ;\r | |
490 | \r | |
b30312ba | 491 | /**\r |
dce655e8 | 492 | Find files under current directory\r |
493 | All files and sub-directories in current directory\r | |
494 | will be stored in DirectoryMenu for future use.\r | |
b30312ba | 495 | \r |
dce655e8 | 496 | @param FileOption Pointer for Dir to explore.\r |
b30312ba | 497 | \r |
dce655e8 | 498 | @retval TRUE Get files from current dir successfully.\r |
499 | @retval FALSE Can't get files from current dir.\r | |
b30312ba | 500 | \r |
501 | **/\r | |
93e3992d | 502 | EFI_STATUS\r |
503 | BOpt_FindFiles (\r | |
504 | IN BMM_CALLBACK_DATA *CallbackData,\r | |
505 | IN BM_MENU_ENTRY *MenuEntry\r | |
506 | )\r | |
507 | ;\r | |
508 | \r | |
b30312ba | 509 | /**\r |
93e3992d | 510 | \r |
dce655e8 | 511 | Find drivers that will be added as Driver#### variables from handles\r |
512 | in current system environment\r | |
513 | All valid handles in the system except those consume SimpleFs, LoadFile\r | |
514 | are stored in DriverMenu for future use.\r | |
b30312ba | 515 | \r |
dce655e8 | 516 | @param VOID \r |
b30312ba | 517 | \r |
dce655e8 | 518 | @retval EFI_SUCCESS The function complets successfully.\r |
519 | @return Other value if failed to build the DriverMenu.\r | |
b30312ba | 520 | \r |
521 | **/\r | |
93e3992d | 522 | EFI_STATUS\r |
523 | BOpt_FindDrivers (\r | |
524 | VOID\r | |
525 | )\r | |
526 | ;\r | |
527 | \r | |
b30312ba | 528 | /**\r |
b30312ba | 529 | \r |
dce655e8 | 530 | Build the BootOptionMenu according to BootOrder Variable.\r |
531 | This Routine will access the Boot#### to get EFI_LOAD_OPTION.\r | |
b30312ba | 532 | \r |
dce655e8 | 533 | @param None\r |
b30312ba | 534 | \r |
dce655e8 | 535 | @return The number of the Var Boot####.\r |
b30312ba | 536 | \r |
537 | **/\r | |
93e3992d | 538 | EFI_STATUS\r |
539 | BOpt_GetBootOptions (\r | |
540 | IN BMM_CALLBACK_DATA *CallbackData\r | |
541 | );\r | |
542 | \r | |
b30312ba | 543 | /**\r |
b30312ba | 544 | \r |
dce655e8 | 545 | Build up all DriverOptionMenu\r |
b30312ba | 546 | \r |
dce655e8 | 547 | @param CallbackData The BMM context data.\r |
548 | \r | |
549 | @return EFI_SUCESS The functin completes successfully.\r | |
550 | @retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.\r | |
551 | \r | |
b30312ba | 552 | \r |
553 | **/\r | |
93e3992d | 554 | EFI_STATUS\r |
555 | BOpt_GetDriverOptions (\r | |
556 | IN BMM_CALLBACK_DATA *CallbackData\r | |
557 | );\r | |
558 | \r | |
93e3992d | 559 | \r |
b30312ba | 560 | /**\r |
dce655e8 | 561 | Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().\r |
b30312ba | 562 | \r |
dce655e8 | 563 | @param VOID\r |
b30312ba | 564 | \r |
dce655e8 | 565 | @retval EFI_SUCCESS The function complete successfully.\r |
566 | @retval EFI_OUT_OF_RESOURCES No enough memory to complete this function.\r | |
b30312ba | 567 | \r |
568 | **/\r | |
93e3992d | 569 | EFI_STATUS\r |
dce655e8 | 570 | BOpt_GetLegacyOptions (\r |
571 | VOID\r | |
572 | );\r | |
93e3992d | 573 | \r |
b30312ba | 574 | /**\r |
dce655e8 | 575 | Free out resouce allocated from Legacy Boot Options.\r |
b30312ba | 576 | \r |
dce655e8 | 577 | @param VOID.\r |
b30312ba | 578 | \r |
dce655e8 | 579 | @return VOID.\r |
b30312ba | 580 | \r |
581 | **/\r | |
93e3992d | 582 | VOID\r |
dce655e8 | 583 | BOpt_FreeLegacyOptions (\r |
584 | VOID\r | |
585 | );\r | |
93e3992d | 586 | \r |
b30312ba | 587 | /**\r |
dce655e8 | 588 | Free resources allocated in Allocate Rountine\r |
b30312ba | 589 | \r |
dce655e8 | 590 | @param FreeMenu Menu to be freed\r |
b30312ba | 591 | \r |
dce655e8 | 592 | @return VOID\r |
b30312ba | 593 | \r |
594 | **/\r | |
93e3992d | 595 | VOID\r |
596 | BOpt_FreeMenu (\r | |
597 | BM_MENU_OPTION *FreeMenu\r | |
598 | );\r | |
599 | \r | |
600 | \r | |
b30312ba | 601 | /**\r |
b30312ba | 602 | \r |
dce655e8 | 603 | Append file name to existing file name.\r |
b30312ba | 604 | \r |
dce655e8 | 605 | @param Str1 The existing file name\r |
606 | @param Str2 The file name to be appended\r | |
607 | \r | |
608 | @return Allocate a new string to hold the appended result.\r | |
609 | Caller is responsible to free the returned string.\r | |
b30312ba | 610 | \r |
611 | **/\r | |
93e3992d | 612 | CHAR16 *\r |
613 | BOpt_AppendFileName (\r | |
614 | IN CHAR16 *Str1,\r | |
615 | IN CHAR16 *Str2\r | |
616 | );\r | |
617 | \r | |
b30312ba | 618 | /**\r |
b30312ba | 619 | \r |
dce655e8 | 620 | Check whether current FileName point to a valid\r |
621 | Efi Image File.\r | |
b30312ba | 622 | \r |
dce655e8 | 623 | @param FileName File need to be checked.\r |
624 | \r | |
625 | @retval TRUE Is Efi Image\r | |
626 | @retval FALSE Not a valid Efi Image\r | |
b30312ba | 627 | \r |
628 | **/\r | |
93e3992d | 629 | BOOLEAN\r |
630 | BOpt_IsEfiImageName (\r | |
631 | IN UINT16 *FileName\r | |
632 | );\r | |
633 | \r | |
b30312ba | 634 | /**\r |
b30312ba | 635 | \r |
dce655e8 | 636 | Check whether current FileName point to a valid Efi Application\r |
b30312ba | 637 | \r |
dce655e8 | 638 | @param Dir Pointer to current Directory\r |
639 | @param FileName Pointer to current File name.\r | |
640 | \r | |
641 | @retval TRUE Is a valid Efi Application\r | |
642 | @retval FALSE not a valid Efi Application\r | |
b30312ba | 643 | \r |
644 | **/\r | |
93e3992d | 645 | BOOLEAN\r |
646 | BOpt_IsEfiApp (\r | |
647 | IN EFI_FILE_HANDLE Dir,\r | |
648 | IN UINT16 *FileName\r | |
649 | );\r | |
650 | \r | |
b30312ba | 651 | /**\r |
b30312ba | 652 | \r |
dce655e8 | 653 | Get the Option Number that has not been allocated for use.\r |
b30312ba | 654 | \r |
dce655e8 | 655 | @param VOID\r |
656 | \r | |
657 | @return The available Option Number.\r | |
b30312ba | 658 | \r |
659 | **/\r | |
93e3992d | 660 | UINT16\r |
dce655e8 | 661 | BOpt_GetBootOptionNumber (\r |
662 | VOID\r | |
663 | );\r | |
93e3992d | 664 | \r |
b30312ba | 665 | /**\r |
b30312ba | 666 | \r |
dce655e8 | 667 | Get the Option Number that is not in use.\r |
b30312ba | 668 | \r |
dce655e8 | 669 | @param VOID\r |
670 | \r | |
671 | @return The unused Option Number.\r | |
b30312ba | 672 | \r |
673 | **/\r | |
93e3992d | 674 | UINT16\r |
dce655e8 | 675 | BOpt_GetDriverOptionNumber (\r |
676 | VOID\r | |
677 | );\r | |
93e3992d | 678 | \r |
b30312ba | 679 | /**\r |
dce655e8 | 680 | Create a menu entry give a Menu type.\r |
b30312ba | 681 | \r |
dce655e8 | 682 | @param MenuType The Menu type to be created.\r |
b30312ba | 683 | \r |
dce655e8 | 684 | \r |
685 | @retval NULL If failed to create the menu.\r | |
686 | @return The menu.\r | |
b30312ba | 687 | \r |
688 | **/\r | |
93e3992d | 689 | BM_MENU_ENTRY *\r |
690 | BOpt_CreateMenuEntry (\r | |
691 | UINTN MenuType\r | |
692 | );\r | |
693 | \r | |
b30312ba | 694 | /**\r |
dce655e8 | 695 | Free up all resource allocated for a BM_MENU_ENTRY.\r |
b30312ba | 696 | \r |
dce655e8 | 697 | @param MenuEntry A pointer to BM_MENU_ENTRY.\r |
b30312ba | 698 | \r |
dce655e8 | 699 | @retval VOID\r |
b30312ba | 700 | \r |
701 | **/\r | |
93e3992d | 702 | VOID\r |
703 | BOpt_DestroyMenuEntry (\r | |
704 | BM_MENU_ENTRY *MenuEntry\r | |
705 | );\r | |
706 | \r | |
b30312ba | 707 | /**\r |
dce655e8 | 708 | Get the Menu Entry from the list in Menu Entry List.\r |
b30312ba | 709 | \r |
dce655e8 | 710 | If MenuNumber is great or equal to the number of Menu\r |
711 | Entry in the list, then ASSERT.\r | |
b30312ba | 712 | \r |
dce655e8 | 713 | @param MenuOption The Menu Entry List to read the menu entry.\r |
714 | @param MenuNumber The index of Menu Entry.\r | |
715 | \r | |
716 | @return The Menu Entry.\r | |
b30312ba | 717 | \r |
718 | **/\r | |
93e3992d | 719 | BM_MENU_ENTRY *\r |
720 | BOpt_GetMenuEntry (\r | |
721 | BM_MENU_OPTION *MenuOption,\r | |
722 | UINTN MenuNumber\r | |
723 | );\r | |
724 | \r | |
93e3992d | 725 | //\r |
726 | // Locate all serial io devices for console\r | |
727 | //\r | |
b30312ba | 728 | /**\r |
dce655e8 | 729 | Build a list containing all serial devices\r |
730 | \r | |
b30312ba | 731 | \r |
732 | @param VOID EDES_TODO: Add parameter description\r | |
733 | \r | |
734 | @return EDES_TODO: Add description for return value\r | |
735 | \r | |
736 | **/\r | |
93e3992d | 737 | EFI_STATUS\r |
dce655e8 | 738 | LocateSerialIo (\r |
739 | VOID\r | |
740 | );\r | |
93e3992d | 741 | \r |
742 | //\r | |
743 | // Initializing Console menu\r | |
744 | //\r | |
b30312ba | 745 | /**\r |
dce655e8 | 746 | Build up ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu\r |
b30312ba | 747 | \r |
b30312ba | 748 | \r |
dce655e8 | 749 | @param VOID\r |
750 | \r | |
751 | @retval EFI_SUCCESS The function always complete successfully.\r | |
b30312ba | 752 | \r |
753 | **/\r | |
93e3992d | 754 | EFI_STATUS\r |
dce655e8 | 755 | GetAllConsoles(\r |
756 | VOID\r | |
757 | );\r | |
93e3992d | 758 | \r |
759 | //\r | |
760 | // Get current mode information\r | |
761 | //\r | |
b30312ba | 762 | /**\r |
dce655e8 | 763 | Get mode number according to column and row\r |
b30312ba | 764 | \r |
b30312ba | 765 | \r |
dce655e8 | 766 | @param CallbackData The BMM context data.\r |
767 | \r | |
768 | @return VOID\r | |
b30312ba | 769 | \r |
770 | **/\r | |
93e3992d | 771 | VOID\r |
772 | GetConsoleOutMode (\r | |
773 | IN BMM_CALLBACK_DATA *CallbackData\r | |
774 | );\r | |
775 | \r | |
776 | //\r | |
777 | // Cleaning up console menu\r | |
778 | //\r | |
b30312ba | 779 | /**\r |
dce655e8 | 780 | Free ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu\r |
b30312ba | 781 | \r |
b30312ba | 782 | \r |
dce655e8 | 783 | @param VOID EDES_TODO: Add parameter description\r |
b30312ba | 784 | \r |
dce655e8 | 785 | @retval EFI_SUCCESS The function always complete successfully.\r |
b30312ba | 786 | **/\r |
93e3992d | 787 | EFI_STATUS\r |
dce655e8 | 788 | FreeAllConsoles (\r |
789 | VOID\r | |
790 | );\r | |
93e3992d | 791 | \r |
b30312ba | 792 | /**\r |
dce655e8 | 793 | Update the device path that describing a terminal device\r |
794 | based on the new BaudRate, Data Bits, parity and Stop Bits\r | |
795 | set.\r | |
b30312ba | 796 | \r |
dce655e8 | 797 | @param DevicePath\r |
b30312ba | 798 | \r |
dce655e8 | 799 | @return VOID\r |
b30312ba | 800 | \r |
801 | **/\r | |
93e3992d | 802 | VOID\r |
803 | ChangeVariableDevicePath (\r | |
804 | EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
805 | );\r | |
806 | \r | |
b30312ba | 807 | /**\r |
dce655e8 | 808 | Update the multi-instance device path of Terminal Device based on\r |
809 | the global TerminalMenu. If ChangeTernimal is TRUE, the terminal \r | |
810 | device path in the Terminal Device in TerminalMenu is also updated.\r | |
b30312ba | 811 | \r |
dce655e8 | 812 | @param DevicePath The multi-instance device path.\r |
813 | @param ChangeTerminal TRUE, then device path in the Terminal Device \r | |
814 | in TerminalMenu is also updated; FALSE, no update.\r | |
b30312ba | 815 | \r |
dce655e8 | 816 | @return EFI_SUCCESS The function completes successfully.\r |
b30312ba | 817 | \r |
818 | **/\r | |
93e3992d | 819 | EFI_STATUS\r |
820 | ChangeTerminalDevicePath (\r | |
821 | EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
822 | BOOLEAN ChangeTerminal\r | |
823 | );\r | |
824 | //\r | |
825 | // Variable operation by menu selection\r | |
826 | //\r | |
b30312ba | 827 | /**\r |
dce655e8 | 828 | This function create a currently loaded Boot Option from \r |
829 | the BMM. It then appends this Boot Option to the end of \r | |
830 | the "BootOrder" list. It also append this Boot Opotion to the end\r | |
831 | of BootOptionMenu.\r | |
b30312ba | 832 | \r |
dce655e8 | 833 | @param CallbackData The BMM context data.\r |
834 | @param NvRamMap The file explorer formset internal state.\r | |
b30312ba | 835 | \r |
dce655e8 | 836 | @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.\r |
837 | @retval EFI_SUCCESS If function completes successfully.\r | |
b30312ba | 838 | \r |
839 | **/\r | |
93e3992d | 840 | EFI_STATUS\r |
841 | Var_UpdateBootOption (\r | |
842 | IN BMM_CALLBACK_DATA *CallbackData,\r | |
843 | IN FILE_EXPLORER_NV_DATA *NvRamMap\r | |
844 | );\r | |
845 | \r | |
b30312ba | 846 | /**\r |
dce655e8 | 847 | Delete Boot Option that represent a Deleted state in BootOptionMenu.\r |
848 | After deleting this boot option, call Var_ChangeBootOrder to\r | |
849 | make sure BootOrder is in valid state.\r | |
850 | \r | |
b30312ba | 851 | \r |
852 | @param VOID EDES_TODO: Add parameter description\r | |
853 | \r | |
dce655e8 | 854 | @retval EFI_SUCCESS If all boot load option EFI Variables corresponding to \r |
855 | BM_LOAD_CONTEXT marked for deletion is deleted\r | |
856 | @return Others If failed to update the "BootOrder" variable after deletion. \r | |
b30312ba | 857 | \r |
858 | **/\r | |
93e3992d | 859 | EFI_STATUS\r |
dce655e8 | 860 | Var_DelBootOption (\r |
861 | VOID\r | |
862 | );\r | |
93e3992d | 863 | \r |
b30312ba | 864 | /**\r |
dce655e8 | 865 | After any operation on Boot####, there will be a discrepancy in BootOrder.\r |
866 | Since some are missing but in BootOrder, while some are present but are\r | |
867 | not reflected by BootOrder. Then a function rebuild BootOrder from\r | |
868 | scratch by content from BootOptionMenu is needed.\r | |
b30312ba | 869 | \r |
b30312ba | 870 | \r |
dce655e8 | 871 | @param VOID\r |
872 | \r | |
873 | @retval EFI_SUCCESS The boot order is updated successfully.\r | |
874 | @return EFI_STATUS other than EFI_SUCCESS if failed to\r | |
875 | Set the "BootOrder" EFI Variable.\r | |
b30312ba | 876 | \r |
877 | **/\r | |
93e3992d | 878 | EFI_STATUS\r |
dce655e8 | 879 | Var_ChangeBootOrder (\r |
880 | VOID\r | |
881 | );\r | |
93e3992d | 882 | \r |
b30312ba | 883 | /**\r |
dce655e8 | 884 | This function create a currently loaded Drive Option from \r |
885 | the BMM. It then appends this Driver Option to the end of \r | |
886 | the "DriverOrder" list. It append this Driver Opotion to the end\r | |
887 | of DriverOptionMenu.\r | |
b30312ba | 888 | \r |
dce655e8 | 889 | @param CallbackData The BMM context data.\r |
890 | @param HiiHandle The HII handle associated with the BMM formset.\r | |
891 | @param DescriptionData The description of this driver option.\r | |
892 | @param OptionalData The optional load option.\r | |
b30312ba | 893 | @param ForceReconnect EDES_TODO: Add parameter description\r |
894 | \r | |
dce655e8 | 895 | @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.\r |
896 | @retval EFI_SUCCESS If function completes successfully.\r | |
b30312ba | 897 | \r |
898 | **/\r | |
93e3992d | 899 | EFI_STATUS\r |
900 | Var_UpdateDriverOption (\r | |
901 | IN BMM_CALLBACK_DATA *CallbackData,\r | |
902 | IN EFI_HII_HANDLE HiiHandle,\r | |
903 | IN UINT16 *DescriptionData,\r | |
904 | IN UINT16 *OptionalData,\r | |
905 | IN UINT8 ForceReconnect\r | |
906 | );\r | |
907 | \r | |
b30312ba | 908 | /**\r |
dce655e8 | 909 | Delete Load Option that represent a Deleted state in BootOptionMenu.\r |
910 | After deleting this Driver option, call Var_ChangeDriverOrder to\r | |
911 | make sure DriverOrder is in valid state.\r | |
b30312ba | 912 | \r |
b30312ba | 913 | \r |
dce655e8 | 914 | @param VOID\r |
915 | \r | |
916 | @retval EFI_SUCCESS Load Option is successfully updated.\r | |
917 | @return Other value than EFI_SUCCESS if failed to update "Driver Order" EFI\r | |
918 | Variable.\r | |
b30312ba | 919 | \r |
920 | **/\r | |
93e3992d | 921 | EFI_STATUS\r |
dce655e8 | 922 | Var_DelDriverOption (\r |
923 | VOID\r | |
924 | );\r | |
93e3992d | 925 | \r |
b30312ba | 926 | /**\r |
dce655e8 | 927 | After any operation on Driver####, there will be a discrepancy in\r |
928 | DriverOrder. Since some are missing but in DriverOrder, while some\r | |
929 | are present but are not reflected by DriverOrder. Then a function\r | |
930 | rebuild DriverOrder from scratch by content from DriverOptionMenu is\r | |
931 | needed.\r | |
b30312ba | 932 | \r |
b30312ba | 933 | \r |
dce655e8 | 934 | @param VOID\r |
935 | \r | |
936 | @retval EFI_SUCCESS The driver order is updated successfully.\r | |
937 | @return EFI_STATUS other than EFI_SUCCESS if failed to\r | |
938 | Set the "DriverOrder" EFI Variable.\r | |
b30312ba | 939 | \r |
940 | **/\r | |
93e3992d | 941 | EFI_STATUS\r |
dce655e8 | 942 | Var_ChangeDriverOrder (\r |
943 | VOID\r | |
944 | );\r | |
93e3992d | 945 | \r |
b30312ba | 946 | /**\r |
dce655e8 | 947 | This function delete and build multi-instance device path ConIn\r |
948 | console device.\r | |
b30312ba | 949 | \r |
b30312ba | 950 | \r |
dce655e8 | 951 | @param VOID\r |
b30312ba | 952 | \r |
dce655e8 | 953 | @retval EFI_SUCCESS The function complete successfully.\r |
954 | @return The EFI variable can be saved. See gRT->SetVariable \r | |
955 | for detail return information.\r | |
b30312ba | 956 | **/\r |
93e3992d | 957 | EFI_STATUS\r |
dce655e8 | 958 | Var_UpdateConsoleInpOption (\r |
959 | VOID\r | |
960 | );\r | |
93e3992d | 961 | \r |
b30312ba | 962 | /**\r |
dce655e8 | 963 | This function delete and build multi-instance device path ConOut\r |
964 | console device.\r | |
b30312ba | 965 | \r |
b30312ba | 966 | \r |
dce655e8 | 967 | @param VOID\r |
b30312ba | 968 | \r |
dce655e8 | 969 | @retval EFI_SUCCESS The function complete successfully.\r |
970 | @return The EFI variable can be saved. See gRT->SetVariable \r | |
971 | for detail return information.\r | |
b30312ba | 972 | **/\r |
93e3992d | 973 | EFI_STATUS\r |
dce655e8 | 974 | Var_UpdateConsoleOutOption (\r |
975 | VOID\r | |
976 | );\r | |
93e3992d | 977 | \r |
b30312ba | 978 | /**\r |
dce655e8 | 979 | This function delete and build multi-instance device path ErrOut\r |
980 | console device.\r | |
b30312ba | 981 | \r |
b30312ba | 982 | \r |
dce655e8 | 983 | @param VOID\r |
b30312ba | 984 | \r |
dce655e8 | 985 | @retval EFI_SUCCESS The function complete successfully.\r |
986 | @return The EFI variable can be saved. See gRT->SetVariable \r | |
987 | for detail return information.\r | |
b30312ba | 988 | **/\r |
93e3992d | 989 | EFI_STATUS\r |
dce655e8 | 990 | Var_UpdateErrorOutOption (\r |
991 | VOID\r | |
992 | );\r | |
93e3992d | 993 | \r |
b30312ba | 994 | /**\r |
dce655e8 | 995 | Update the device path of "ConOut", "ConIn" and "ErrOut" \r |
996 | based on the new BaudRate, Data Bits, parity and Stop Bits\r | |
997 | set.\r | |
b30312ba | 998 | \r |
dce655e8 | 999 | @param VOID\r |
b30312ba | 1000 | \r |
dce655e8 | 1001 | @return VOID\r |
b30312ba | 1002 | \r |
1003 | **/\r | |
93e3992d | 1004 | VOID\r |
dce655e8 | 1005 | Var_UpdateAllConsoleOption (\r |
1006 | VOID\r | |
1007 | );\r | |
93e3992d | 1008 | \r |
b30312ba | 1009 | /**\r |
dce655e8 | 1010 | This function update the "BootNext" EFI Variable. If there is \r |
1011 | no "BootNex" specified in BMM, this EFI Variable is deleted.\r | |
1012 | It also update the BMM context data specified the "BootNext"\r | |
1013 | vaule.\r | |
b30312ba | 1014 | \r |
dce655e8 | 1015 | @param CallbackData The BMM context data.\r |
b30312ba | 1016 | \r |
dce655e8 | 1017 | @retval EFI_SUCCESS The function complete successfully.\r |
1018 | @return The EFI variable can be saved. See gRT->SetVariable \r | |
1019 | for detail return information.\r | |
b30312ba | 1020 | \r |
1021 | **/\r | |
93e3992d | 1022 | EFI_STATUS\r |
1023 | Var_UpdateBootNext (\r | |
1024 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1025 | );\r | |
1026 | \r | |
b30312ba | 1027 | /**\r |
dce655e8 | 1028 | This function update the "BootOrder" EFI Variable based on\r |
1029 | BMM Formset's NV map. It then refresh BootOptionMenu\r | |
1030 | with the new "BootOrder" list.\r | |
b30312ba | 1031 | \r |
dce655e8 | 1032 | @param CallbackData The BMM context data.\r |
b30312ba | 1033 | \r |
dce655e8 | 1034 | @retval EFI_SUCCESS The function complete successfully.\r |
1035 | @retval EFI_SUCCESS Not enough memory to complete the function.\r | |
1036 | @return The EFI variable can be saved. See gRT->SetVariable \r | |
1037 | for detail return information.\r | |
b30312ba | 1038 | \r |
1039 | **/\r | |
93e3992d | 1040 | EFI_STATUS\r |
1041 | Var_UpdateBootOrder (\r | |
1042 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1043 | );\r | |
1044 | \r | |
b30312ba | 1045 | /**\r |
dce655e8 | 1046 | This function update the "DriverOrder" EFI Variable based on\r |
1047 | BMM Formset's NV map. It then refresh DriverOptionMenu\r | |
1048 | with the new "DriverOrder" list.\r | |
b30312ba | 1049 | \r |
dce655e8 | 1050 | @param CallbackData The BMM context data.\r |
b30312ba | 1051 | \r |
dce655e8 | 1052 | @retval EFI_SUCCESS The function complete successfully.\r |
1053 | @retval EFI_SUCCESS Not enough memory to complete the function.\r | |
1054 | @return The EFI variable can be saved. See gRT->SetVariable \r | |
1055 | for detail return information.\r | |
b30312ba | 1056 | \r |
1057 | **/\r | |
93e3992d | 1058 | EFI_STATUS\r |
1059 | Var_UpdateDriverOrder (\r | |
1060 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1061 | );\r | |
1062 | \r | |
b30312ba | 1063 | /**\r |
dce655e8 | 1064 | Update the legacy BBS boot option. L"LegacyDevOrder" and EfiLegacyDevOrderGuid EFI Variable\r |
1065 | is udpated with the new Legacy Boot order. The EFI Variable of "Boot####" and gEfiGlobalVariableGuid\r | |
1066 | is also updated.\r | |
b30312ba | 1067 | \r |
dce655e8 | 1068 | @param CallbackData The context data for BMM.\r |
b30312ba | 1069 | \r |
dce655e8 | 1070 | @return EFI_SUCCESS The function completed successfully.\r |
1071 | @retval EFI_NOT_FOUND If L"LegacyDevOrder" and EfiLegacyDevOrderGuid EFI Variable can be found.\r | |
b30312ba | 1072 | \r |
1073 | **/\r | |
93e3992d | 1074 | EFI_STATUS\r |
1075 | Var_UpdateBBSOption (\r | |
1076 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1077 | );\r | |
1078 | \r | |
b30312ba | 1079 | /**\r |
dce655e8 | 1080 | Update the Text Mode of Console.\r |
b30312ba | 1081 | \r |
dce655e8 | 1082 | @param CallbackData The context data for BMM.\r |
b30312ba | 1083 | \r |
dce655e8 | 1084 | @retval EFI_SUCCSS If the Text Mode of Console is updated.\r |
1085 | @return Other value if the Text Mode of Console is not updated.\r | |
b30312ba | 1086 | \r |
1087 | **/\r | |
93e3992d | 1088 | EFI_STATUS\r |
1089 | Var_UpdateConMode (\r | |
1090 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1091 | );\r | |
1092 | \r | |
1093 | //\r | |
1094 | // Following are page create and refresh functions\r | |
1095 | //\r | |
b30312ba | 1096 | /**\r |
dce655e8 | 1097 | Refresh the global UpdateData structure.\r |
b30312ba | 1098 | \r |
dce655e8 | 1099 | @param VOID\r |
b30312ba | 1100 | \r |
dce655e8 | 1101 | @return VOID\r |
b30312ba | 1102 | \r |
1103 | **/\r | |
93e3992d | 1104 | VOID\r |
1105 | RefreshUpdateData (\r | |
1106 | VOID\r | |
1107 | );\r | |
1108 | \r | |
b30312ba | 1109 | /**\r |
dce655e8 | 1110 | Clean up the dynamic opcode at label and form specified by\r |
1111 | both LabelId. \r | |
b30312ba | 1112 | \r |
dce655e8 | 1113 | @param LabelId It is both the Form ID and Label ID for\r |
1114 | opcode deletion.\r | |
1115 | @param CallbackData The BMM context data.\r | |
b30312ba | 1116 | \r |
dce655e8 | 1117 | @return VOID\r |
b30312ba | 1118 | \r |
1119 | **/\r | |
93e3992d | 1120 | VOID\r |
1121 | CleanUpPage (\r | |
1122 | IN UINT16 LabelId,\r | |
1123 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1124 | );\r | |
1125 | \r | |
b30312ba | 1126 | /**\r |
dce655e8 | 1127 | Create a lit of boot option from global BootOptionMenu. It\r |
1128 | allow user to delete the boot option.\r | |
b30312ba | 1129 | \r |
dce655e8 | 1130 | @param CallbackData The BMM context data.\r |
b30312ba | 1131 | \r |
dce655e8 | 1132 | @return VOID\r |
b30312ba | 1133 | \r |
1134 | **/\r | |
93e3992d | 1135 | VOID\r |
1136 | UpdateBootDelPage (\r | |
1137 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1138 | );\r | |
1139 | \r | |
b30312ba | 1140 | /**\r |
dce655e8 | 1141 | Create a lit of driver option from global DriverMenu.\r |
b30312ba | 1142 | \r |
dce655e8 | 1143 | @param CallbackData The BMM context data.\r |
b30312ba | 1144 | \r |
dce655e8 | 1145 | @return VOID\r |
b30312ba | 1146 | \r |
1147 | **/\r | |
93e3992d | 1148 | VOID\r |
1149 | UpdateDrvAddHandlePage (\r | |
1150 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1151 | );\r | |
1152 | \r | |
b30312ba | 1153 | /**\r |
dce655e8 | 1154 | Create a lit of driver option from global DriverOptionMenu. It\r |
1155 | allow user to delete the driver option.\r | |
b30312ba | 1156 | \r |
b30312ba | 1157 | \r |
dce655e8 | 1158 | @param CallbackData The BMM context data.\r |
1159 | \r | |
1160 | @return VOID\r | |
b30312ba | 1161 | \r |
1162 | **/\r | |
93e3992d | 1163 | VOID\r |
1164 | UpdateDrvDelPage (\r | |
1165 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1166 | );\r | |
1167 | \r | |
b30312ba | 1168 | /**\r |
dce655e8 | 1169 | Prepare the page to allow user to add description for \r |
1170 | a Driver Option.\r | |
b30312ba | 1171 | \r |
dce655e8 | 1172 | @param CallbackData The BMM context data.\r |
b30312ba | 1173 | \r |
dce655e8 | 1174 | @return VOID\r |
b30312ba | 1175 | \r |
1176 | **/\r | |
93e3992d | 1177 | VOID\r |
1178 | UpdateDriverAddHandleDescPage (\r | |
1179 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1180 | );\r | |
1181 | \r | |
b30312ba | 1182 | /**\r |
dce655e8 | 1183 | Dispatch the correct update page function to call based on\r |
1184 | the UpdatePageId.\r | |
b30312ba | 1185 | \r |
dce655e8 | 1186 | @param UpdatePageId The form ID.\r |
1187 | @param CallbackData The BMM context data.\r | |
b30312ba | 1188 | \r |
dce655e8 | 1189 | @return VOID\r |
b30312ba | 1190 | \r |
1191 | **/\r | |
93e3992d | 1192 | VOID\r |
1193 | UpdatePageBody (\r | |
1194 | IN UINT16 UpdatePageId,\r | |
1195 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1196 | );\r | |
1197 | \r | |
b30312ba | 1198 | /**\r |
dce655e8 | 1199 | Create the dynamic page to allow user to set\r |
1200 | the "BootNext" vaule.\r | |
b30312ba | 1201 | \r |
dce655e8 | 1202 | @param CallbackData The BMM context data.\r |
b30312ba | 1203 | \r |
dce655e8 | 1204 | @return VOID\r |
b30312ba | 1205 | \r |
1206 | **/\r | |
93e3992d | 1207 | VOID\r |
1208 | UpdateBootNextPage (\r | |
1209 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1210 | );\r | |
1211 | \r | |
b30312ba | 1212 | /**\r |
dce655e8 | 1213 | Create the dynamic page to allow user to set\r |
1214 | the "TimeOut" vaule.\r | |
b30312ba | 1215 | \r |
dce655e8 | 1216 | @param CallbackData The BMM context data.\r |
b30312ba | 1217 | \r |
dce655e8 | 1218 | @return VOID\r |
b30312ba | 1219 | \r |
1220 | **/\r | |
93e3992d | 1221 | VOID\r |
1222 | UpdateTimeOutPage (\r | |
1223 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1224 | );\r | |
1225 | \r | |
b30312ba | 1226 | /**\r |
dce655e8 | 1227 | Create the dynamic page which allows user to \r |
1228 | set the property such as Baud Rate, Data Bits,\r | |
1229 | Parity, Stop Bits, Terminal Type.\r | |
b30312ba | 1230 | \r |
dce655e8 | 1231 | @param CallbackData The BMM context data.\r |
b30312ba | 1232 | \r |
dce655e8 | 1233 | @return VOID\r |
b30312ba | 1234 | \r |
1235 | **/\r | |
93e3992d | 1236 | VOID\r |
1237 | UpdateTerminalPage (\r | |
1238 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1239 | );\r | |
1240 | \r | |
b30312ba | 1241 | /**\r |
dce655e8 | 1242 | Refresh the text mode page\r |
b30312ba | 1243 | \r |
b30312ba | 1244 | \r |
dce655e8 | 1245 | @param CallbackData The BMM context data.\r |
1246 | \r | |
1247 | @return VOID\r | |
b30312ba | 1248 | \r |
1249 | **/\r | |
93e3992d | 1250 | VOID\r |
1251 | UpdateConModePage (\r | |
1252 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1253 | );\r | |
1254 | \r | |
b30312ba | 1255 | /**\r |
dce655e8 | 1256 | Create a list of Goto Opcode for all terminal devices logged\r |
1257 | by TerminaMenu. This list will be inserted to form FORM_CON_COM_SETUP_ID.\r | |
b30312ba | 1258 | \r |
dce655e8 | 1259 | @param CallbackData The BMM context data.\r |
b30312ba | 1260 | \r |
dce655e8 | 1261 | @return VOID\r |
b30312ba | 1262 | \r |
1263 | **/\r | |
93e3992d | 1264 | VOID\r |
1265 | UpdateConCOMPage (\r | |
1266 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1267 | );\r | |
1268 | \r | |
b30312ba | 1269 | /**\r |
dce655e8 | 1270 | Create a dynamic page so that Legacy Device boot order\r |
1271 | can be set for specified device type.\r | |
b30312ba | 1272 | \r |
dce655e8 | 1273 | @param UpdatePageId The form ID. It also spefies the legacy device type.\r |
1274 | @param CallbackData The BMM context data.\r | |
b30312ba | 1275 | \r |
dce655e8 | 1276 | @return VOID\r |
b30312ba | 1277 | \r |
1278 | **/\r | |
93e3992d | 1279 | VOID\r |
1280 | UpdateSetLegacyDeviceOrderPage (\r | |
1281 | IN UINT16 UpdatePageId,\r | |
1282 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1283 | );\r | |
1284 | \r | |
93e3992d | 1285 | \r |
b30312ba | 1286 | /**\r |
b30312ba | 1287 | \r |
dce655e8 | 1288 | Function opens and returns a file handle to the root directory of a volume.\r |
b30312ba | 1289 | \r |
b30312ba | 1290 | \r |
dce655e8 | 1291 | @param DeviceHandle - A handle for a device\r |
b30312ba | 1292 | \r |
dce655e8 | 1293 | @return A valid file handle or NULL is returned\r |
b30312ba | 1294 | \r |
1295 | **/\r | |
93e3992d | 1296 | EFI_FILE_HANDLE\r |
1297 | EfiLibOpenRoot (\r | |
1298 | IN EFI_HANDLE DeviceHandle\r | |
1299 | );\r | |
1300 | \r | |
b30312ba | 1301 | /**\r |
b30312ba | 1302 | \r |
dce655e8 | 1303 | Function gets the file system information from an open file descriptor,\r |
1304 | and stores it in a buffer allocated from pool.\r | |
b30312ba | 1305 | \r |
dce655e8 | 1306 | \r |
1307 | @param FHand The file handle.\r | |
1308 | \r | |
1309 | @return A pointer to a buffer with file information.\r | |
1310 | @retval NULL is returned if failed to get Vaolume Label Info.\r | |
b30312ba | 1311 | \r |
1312 | **/\r | |
93e3992d | 1313 | EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *\r |
1314 | EfiLibFileSystemVolumeLabelInfo (\r | |
1315 | IN EFI_FILE_HANDLE FHand\r | |
1316 | );\r | |
1317 | \r | |
b30312ba | 1318 | /**\r |
b30312ba | 1319 | \r |
dce655e8 | 1320 | Function gets the file information from an open file descriptor, and stores it\r |
1321 | in a buffer allocated from pool.\r | |
b30312ba | 1322 | \r |
dce655e8 | 1323 | @param FHand File Handle.\r |
1324 | \r | |
1325 | @return A pointer to a buffer with file information or NULL is returned\r | |
b30312ba | 1326 | \r |
1327 | **/\r | |
93e3992d | 1328 | EFI_FILE_INFO *\r |
1329 | EfiLibFileInfo (\r | |
1330 | IN EFI_FILE_HANDLE FHand\r | |
1331 | );\r | |
1332 | \r | |
b30312ba | 1333 | /**\r |
b30312ba | 1334 | \r |
dce655e8 | 1335 | change a Unicode string t ASCII string\r |
b30312ba | 1336 | \r |
dce655e8 | 1337 | \r |
1338 | @param UStr Unicode string\r | |
1339 | Lenght - most possible length of AStr\r | |
1340 | @param Length The length of UStr.\r | |
1341 | @param AStr ASCII string to pass out\r | |
1342 | \r | |
1343 | @return Actual length\r | |
b30312ba | 1344 | \r |
1345 | **/\r | |
93e3992d | 1346 | UINTN\r |
1347 | UnicodeToAscii (\r | |
1348 | IN CHAR16 *UStr,\r | |
1349 | IN UINTN Length,\r | |
1350 | OUT CHAR8 *AStr\r | |
1351 | );\r | |
1352 | \r | |
b30312ba | 1353 | /**\r |
dce655e8 | 1354 | This function converts an input device structure to a Unicode string.\r |
b30312ba | 1355 | \r |
dce655e8 | 1356 | @param DevPath A pointer to the device path structure.\r |
b30312ba | 1357 | \r |
dce655e8 | 1358 | @return A new allocated Unicode string that represents the device path.\r |
b30312ba | 1359 | \r |
1360 | **/\r | |
93e3992d | 1361 | CHAR16 *\r |
1362 | DevicePathToStr (\r | |
1363 | EFI_DEVICE_PATH_PROTOCOL *DevPath\r | |
1364 | );\r | |
1365 | \r | |
b30312ba | 1366 | /**\r |
b30312ba | 1367 | \r |
dce655e8 | 1368 | Find the first instance of this Protocol\r |
1369 | in the system and return it's interface\r | |
93e3992d | 1370 | \r |
b30312ba | 1371 | \r |
dce655e8 | 1372 | @param ProtocolGuid Provides the protocol to search for\r |
1373 | @param Interface On return, a pointer to the first interface\r | |
1374 | that matches ProtocolGuid\r | |
b30312ba | 1375 | \r |
dce655e8 | 1376 | @retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found\r |
1377 | @retval EFI_NOT_FOUND No protocol instances were found that match ProtocolGuid\r | |
b30312ba | 1378 | \r |
1379 | **/\r | |
93e3992d | 1380 | EFI_STATUS\r |
1381 | EfiLibLocateProtocol (\r | |
1382 | IN EFI_GUID *ProtocolGuid,\r | |
1383 | OUT VOID **Interface\r | |
1384 | );\r | |
1385 | \r | |
b30312ba | 1386 | /**\r |
dce655e8 | 1387 | Adjusts the size of a previously allocated buffer.\r |
b30312ba | 1388 | \r |
b30312ba | 1389 | \r |
dce655e8 | 1390 | @param OldPool - A pointer to the buffer whose size is being adjusted.\r |
1391 | @param OldSize - The size of the current buffer.\r | |
1392 | @param NewSize - The size of the new buffer.\r | |
1393 | \r | |
1394 | @return The newly allocated buffer.\r | |
1395 | @retval NULL Allocation failed.\r | |
b30312ba | 1396 | \r |
1397 | **/\r | |
93e3992d | 1398 | VOID *\r |
1399 | EfiReallocatePool (\r | |
1400 | IN VOID *OldPool,\r | |
1401 | IN UINTN OldSize,\r | |
1402 | IN UINTN NewSize\r | |
1403 | );\r | |
1404 | \r | |
b30312ba | 1405 | /**\r |
dce655e8 | 1406 | Read the EFI variable (VendorGuid/Name) and return a dynamically allocated\r |
1407 | buffer, and the size of the buffer. If failure return NULL.\r | |
b30312ba | 1408 | \r |
dce655e8 | 1409 | @param Name String part of EFI variable name\r |
1410 | @param VendorGuid GUID part of EFI variable name\r | |
1411 | @param VariableSize Returns the size of the EFI variable that was read\r | |
b30312ba | 1412 | \r |
dce655e8 | 1413 | @return Dynamically allocated memory that contains a copy of the EFI variable.\r |
1414 | @return Caller is responsible freeing the buffer.\r | |
1415 | @retval NULL Variable was not read\r | |
b30312ba | 1416 | \r |
1417 | **/\r | |
93e3992d | 1418 | VOID *\r |
1419 | BdsLibGetVariableAndSize (\r | |
1420 | IN CHAR16 *Name,\r | |
1421 | IN EFI_GUID *VendorGuid,\r | |
1422 | OUT UINTN *VarSize\r | |
1423 | );\r | |
1424 | \r | |
b30312ba | 1425 | /**\r |
dce655e8 | 1426 | Function deletes the variable specified by VarName and VarGuid.\r |
b30312ba | 1427 | \r |
b30312ba | 1428 | \r |
dce655e8 | 1429 | @param VarName - A Null-terminated Unicode string that is\r |
1430 | the name of the vendor's variable.\r | |
1431 | \r | |
1432 | @param VendorGuid - A unique identifier for the vendor.\r | |
1433 | \r | |
1434 | @retval EFI_SUCCESS The variable was found and removed\r | |
1435 | @retval EFI_UNSUPPORTED The variable store was inaccessible\r | |
1436 | @retval EFI_OUT_OF_RESOURCES The temporary buffer was not available\r | |
1437 | @retval EFI_NOT_FOUND The variable was not found\r | |
b30312ba | 1438 | \r |
1439 | **/\r | |
93e3992d | 1440 | EFI_STATUS\r |
1441 | EfiLibDeleteVariable (\r | |
1442 | IN CHAR16 *VarName,\r | |
1443 | IN EFI_GUID *VarGuid\r | |
1444 | );\r | |
1445 | \r | |
b30312ba | 1446 | /**\r |
dce655e8 | 1447 | Duplicate a string.\r |
b30312ba | 1448 | \r |
dce655e8 | 1449 | @param Src The source.\r |
b30312ba | 1450 | \r |
dce655e8 | 1451 | @return A new string which is duplicated copy of the source.\r |
1452 | @retval NULL If there is not enough memory.\r | |
b30312ba | 1453 | \r |
1454 | **/\r | |
93e3992d | 1455 | CHAR16 *\r |
1456 | EfiStrDuplicate (\r | |
1457 | IN CHAR16 *Src\r | |
1458 | );\r | |
1459 | \r | |
b30312ba | 1460 | /**\r |
dce655e8 | 1461 | Function is used to determine the number of device path instances\r |
1462 | that exist in a device path.\r | |
93e3992d | 1463 | \r |
b30312ba | 1464 | \r |
dce655e8 | 1465 | @param DevicePath A pointer to a device path data structure.\r |
b30312ba | 1466 | \r |
dce655e8 | 1467 | @return This function counts and returns the number of device path instances\r |
1468 | in DevicePath.\r | |
b30312ba | 1469 | \r |
1470 | **/\r | |
93e3992d | 1471 | UINTN\r |
1472 | EfiDevicePathInstanceCount (\r | |
1473 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
1474 | );\r | |
1475 | \r | |
b30312ba | 1476 | /**\r |
dce655e8 | 1477 | Create string tokens for a menu from its help strings and display strings\r |
b30312ba | 1478 | \r |
b30312ba | 1479 | \r |
dce655e8 | 1480 | @param CallbackData The BMM context data.\r |
1481 | @param HiiHandle Hii Handle of the package to be updated.\r | |
1482 | @param MenuOption The Menu whose string tokens need to be created\r | |
1483 | \r | |
1484 | @retval EFI_SUCCESS string tokens created successfully\r | |
1485 | @retval others contain some errors\r | |
b30312ba | 1486 | \r |
1487 | **/\r | |
93e3992d | 1488 | EFI_STATUS\r |
1489 | CreateMenuStringToken (\r | |
1490 | IN BMM_CALLBACK_DATA *CallbackData,\r | |
1491 | IN EFI_HII_HANDLE HiiHandle,\r | |
1492 | IN BM_MENU_OPTION *MenuOption\r | |
1493 | );\r | |
1494 | \r | |
b30312ba | 1495 | /**\r |
dce655e8 | 1496 | Get a string from the Data Hub record based on \r |
1497 | a device path.\r | |
b30312ba | 1498 | \r |
dce655e8 | 1499 | @param DevPath The device Path.\r |
b30312ba | 1500 | \r |
dce655e8 | 1501 | @return A string located from the Data Hub records based on\r |
1502 | the device path.\r | |
1503 | @retval NULL If failed to get the String from Data Hub.\r | |
b30312ba | 1504 | \r |
1505 | **/\r | |
93e3992d | 1506 | UINT16 *\r |
1507 | EfiLibStrFromDatahub (\r | |
1508 | IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r | |
1509 | );\r | |
1510 | \r | |
b30312ba | 1511 | /**\r |
dce655e8 | 1512 | Get the index number (#### in Boot####) for the boot option pointed to a BBS legacy device type\r |
1513 | specified by DeviceType.\r | |
b30312ba | 1514 | \r |
dce655e8 | 1515 | @param DeviceType The legacy device type. It can be floppy, network, harddisk, cdrom,\r |
1516 | etc.\r | |
1517 | @param OptionIndex Returns the index number (#### in Boot####).\r | |
1518 | @param OptionSize Return the size of the Boot### variable.\r | |
b30312ba | 1519 | \r |
dce655e8 | 1520 | @return VOID\r |
b30312ba | 1521 | \r |
1522 | **/\r | |
93e3992d | 1523 | VOID *\r |
1524 | GetLegacyBootOptionVar (\r | |
1525 | IN UINTN DeviceType,\r | |
1526 | OUT UINTN *OptionIndex,\r | |
1527 | OUT UINTN *OptionSize\r | |
1528 | );\r | |
1529 | \r | |
b30312ba | 1530 | /**\r |
dce655e8 | 1531 | Initialize the Boot Maintenance Utitliy\r |
1532 | \r | |
b30312ba | 1533 | \r |
1534 | @param VOID EDES_TODO: Add parameter description\r | |
1535 | \r | |
dce655e8 | 1536 | @retval EFI_SUCCESS utility ended successfully\r |
1537 | @retval others contain some errors\r | |
b30312ba | 1538 | \r |
1539 | **/\r | |
93e3992d | 1540 | EFI_STATUS\r |
1541 | InitializeBM (\r | |
1542 | VOID\r | |
1543 | );\r | |
1544 | \r | |
b30312ba | 1545 | /**\r |
dce655e8 | 1546 | Start boot maintenance manager\r |
b30312ba | 1547 | \r |
b30312ba | 1548 | \r |
dce655e8 | 1549 | @param VOID\r |
1550 | \r | |
1551 | @retval EFI_SUCCESS If BMM is invoked successfully.\r | |
1552 | @return Other value if BMM return unsuccessfully.\r | |
b30312ba | 1553 | \r |
1554 | **/\r | |
93e3992d | 1555 | EFI_STATUS\r |
1556 | BdsStartBootMaint (\r | |
1557 | VOID\r | |
1558 | );\r | |
1559 | \r | |
b30312ba | 1560 | /**\r |
dce655e8 | 1561 | Intialize all the string depositories.\r |
b30312ba | 1562 | \r |
b30312ba | 1563 | \r |
dce655e8 | 1564 | @param VOID\r |
1565 | \r | |
1566 | @return VOID\r | |
b30312ba | 1567 | \r |
1568 | **/\r | |
93e3992d | 1569 | VOID\r |
dce655e8 | 1570 | InitializeStringDepository (\r |
1571 | VOID\r | |
1572 | );\r | |
93e3992d | 1573 | \r |
b30312ba | 1574 | /**\r |
dce655e8 | 1575 | Fetch a usable string node from the string depository and return the string token.\r |
1576 | \r | |
b30312ba | 1577 | \r |
1578 | @param CallbackData EDES_TODO: Add parameter description\r | |
dce655e8 | 1579 | @param StringDepository - Pointer of the string depository.\r |
b30312ba | 1580 | \r |
dce655e8 | 1581 | @retval EFI_STRING_ID String token.\r |
b30312ba | 1582 | \r |
1583 | **/\r | |
93e3992d | 1584 | EFI_STRING_ID\r |
1585 | GetStringTokenFromDepository (\r | |
1586 | IN BMM_CALLBACK_DATA *CallbackData,\r | |
1587 | IN STRING_DEPOSITORY *StringDepository\r | |
1588 | );\r | |
1589 | \r | |
b30312ba | 1590 | /**\r |
dce655e8 | 1591 | Reclaim string depositories by moving the current node pointer to list head..\r |
b30312ba | 1592 | \r |
b30312ba | 1593 | \r |
dce655e8 | 1594 | @param VOID \r |
1595 | \r | |
1596 | @return VOID\r | |
b30312ba | 1597 | \r |
1598 | **/\r | |
93e3992d | 1599 | VOID\r |
1600 | ReclaimStringDepository (\r | |
1601 | VOID\r | |
1602 | );\r | |
1603 | \r | |
b30312ba | 1604 | /**\r |
dce655e8 | 1605 | Release resource for all the string depositories.\r |
b30312ba | 1606 | \r |
b30312ba | 1607 | \r |
dce655e8 | 1608 | @param VOID\r |
1609 | \r | |
1610 | @return VOID\r | |
b30312ba | 1611 | \r |
1612 | **/\r | |
93e3992d | 1613 | VOID\r |
1614 | CleanUpStringDepository (\r | |
1615 | VOID\r | |
1616 | );\r | |
1617 | \r | |
b30312ba | 1618 | /**\r |
dce655e8 | 1619 | Function handling request to apply changes for BMM pages.\r |
b30312ba | 1620 | \r |
b30312ba | 1621 | \r |
dce655e8 | 1622 | @param Private - Pointer to callback data buffer.\r |
1623 | @param CurrentFakeNVMap - Pointer to buffer holding data of various values used by BMM\r | |
1624 | @param FormId - ID of the form which has sent the request to apply change.\r | |
1625 | \r | |
1626 | @retval EFI_SUCCESS Change successfully applied.\r | |
1627 | @retval Other Error occurs while trying to apply changes.\r | |
b30312ba | 1628 | \r |
1629 | **/\r | |
93e3992d | 1630 | EFI_STATUS\r |
1631 | ApplyChangeHandler (\r | |
1632 | IN BMM_CALLBACK_DATA *Private,\r | |
1633 | IN BMM_FAKE_NV_DATA *CurrentFakeNVMap,\r | |
1634 | IN EFI_FORM_ID FormId\r | |
1635 | );\r | |
1636 | \r | |
b30312ba | 1637 | /**\r |
dce655e8 | 1638 | Discard all changes done to the BMM pages such as Boot Order change,\r |
1639 | Driver order change.\r | |
b30312ba | 1640 | \r |
dce655e8 | 1641 | @param Private The BMM context data.\r |
1642 | @param CurrentFakeNVMap The current Fack NV Map.\r | |
b30312ba | 1643 | \r |
dce655e8 | 1644 | @return VOID\r |
b30312ba | 1645 | \r |
1646 | **/\r | |
93e3992d | 1647 | VOID\r |
1648 | DiscardChangeHandler (\r | |
1649 | IN BMM_CALLBACK_DATA *Private,\r | |
1650 | IN BMM_FAKE_NV_DATA *CurrentFakeNVMap\r | |
1651 | );\r | |
1652 | \r | |
b30312ba | 1653 | /**\r |
dce655e8 | 1654 | Dispatch the display to the next page based on NewPageId.\r |
b30312ba | 1655 | \r |
dce655e8 | 1656 | @param Private The BMM context data.\r |
1657 | @param NewPageId The original page ID.\r | |
b30312ba | 1658 | \r |
dce655e8 | 1659 | @return VOID\r |
b30312ba | 1660 | \r |
1661 | **/\r | |
93e3992d | 1662 | VOID\r |
1663 | UpdatePageId (\r | |
1664 | BMM_CALLBACK_DATA *Private,\r | |
1665 | UINT16 NewPageId\r | |
1666 | );\r | |
1667 | \r | |
b30312ba | 1668 | /**\r |
dce655e8 | 1669 | Boot a file selected by user at File Expoloer of BMM.\r |
b30312ba | 1670 | \r |
dce655e8 | 1671 | @param FileContext The file context data, which contains the device path\r |
1672 | of the file to be boot from.\r | |
b30312ba | 1673 | \r |
dce655e8 | 1674 | @retval EFI_SUCCESS The function completed successfull.\r |
1675 | @retun Other value if the boot from the file fails.\r | |
b30312ba | 1676 | \r |
1677 | **/\r | |
93e3992d | 1678 | EFI_STATUS\r |
1679 | BootThisFile (\r | |
1680 | IN BM_FILE_CONTEXT *FileContext\r | |
1681 | );\r | |
1682 | \r | |
b30312ba | 1683 | /**\r |
dce655e8 | 1684 | Update the file explower page with the refershed file system.\r |
b30312ba | 1685 | \r |
b30312ba | 1686 | \r |
dce655e8 | 1687 | @param CallbackData BMM context data\r |
1688 | @param KeyValue Key value to identify the type of data to expect.\r | |
1689 | \r | |
1690 | @retval TRUE Inform the caller to create a callback packet to exit file explorer.\r | |
1691 | @retval FALSE Indicate that there is no need to exit file explorer.\r | |
b30312ba | 1692 | \r |
1693 | **/\r | |
93e3992d | 1694 | BOOLEAN\r |
1695 | UpdateFileExplorer (\r | |
1696 | IN BMM_CALLBACK_DATA *CallbackData,\r | |
1697 | IN UINT16 KeyValue\r | |
1698 | );\r | |
1699 | \r | |
b30312ba | 1700 | /**\r |
dce655e8 | 1701 | This function processes the results of changes in configuration.\r |
1702 | When user select a interactive opcode, this callback will be triggered.\r | |
1703 | Based on the Question(QuestionId) that triggers the callback, the corresponding\r | |
1704 | actions is performed. It handles:\r | |
b30312ba | 1705 | \r |
dce655e8 | 1706 | 1) the addition of boot option.\r |
1707 | 2) the addition of driver option.\r | |
1708 | 3) exit from file browser\r | |
1709 | 4) update of file content if a dir is selected.\r | |
1710 | 5) boot the file if a file is selected in "boot from file"\r | |
b30312ba | 1711 | \r |
dce655e8 | 1712 | \r |
1713 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
1714 | @param Action Specifies the type of action taken by the browser.\r | |
1715 | @param QuestionId A unique value which is sent to the original exporting driver\r | |
1716 | so that it can identify the type of data to expect.\r | |
1717 | @param Type The type of value for the question.\r | |
1718 | @param Value A pointer to the data being sent to the original exporting driver.\r | |
1719 | @param ActionRequest On return, points to the action requested by the callback function.\r | |
1720 | \r | |
1721 | @retval EFI_SUCCESS The callback successfully handled the action.\r | |
1722 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r | |
1723 | @retval EFI_DEVICE_ERROR The variable could not be saved.\r | |
1724 | @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.\r | |
b30312ba | 1725 | \r |
1726 | **/\r | |
93e3992d | 1727 | EFI_STATUS\r |
1728 | EFIAPI\r | |
1729 | FileExplorerCallback (\r | |
1730 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
1731 | IN EFI_BROWSER_ACTION Action,\r | |
1732 | IN EFI_QUESTION_ID QuestionId,\r | |
1733 | IN UINT8 Type,\r | |
1734 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
1735 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
1736 | );\r | |
1737 | \r | |
b30312ba | 1738 | /**\r |
dce655e8 | 1739 | Dispatch BMM formset and FileExplorer formset.\r |
b30312ba | 1740 | \r |
b30312ba | 1741 | \r |
dce655e8 | 1742 | @param CallbackData The BMM context data.\r |
1743 | \r | |
1744 | @retval EFI_SUCCESS If function complete successfully.\r | |
1745 | @retturn Other value if the Setup Browser process BMM's pages and\r | |
1746 | return unsuccessfully.\r | |
b30312ba | 1747 | \r |
1748 | **/\r | |
93e3992d | 1749 | EFI_STATUS\r |
1750 | FormSetDispatcher (\r | |
1751 | IN BMM_CALLBACK_DATA *CallbackData\r | |
1752 | );\r | |
1753 | \r | |
b30312ba | 1754 | /**\r |
dce655e8 | 1755 | Function returns the value of the specified variable.\r |
b30312ba | 1756 | \r |
b30312ba | 1757 | \r |
dce655e8 | 1758 | @param Name A Null-terminated Unicode string that is\r |
1759 | the name of the vendor's variable.\r | |
1760 | @param VendorGuid A unique identifier for the vendor.\r | |
1761 | \r | |
1762 | @return The payload of the variable.\r | |
1763 | @retval NULL If the variable can't be read.\r | |
b30312ba | 1764 | \r |
1765 | **/\r | |
fd6a62f3 | 1766 | VOID *\r |
1767 | EfiLibGetVariable (\r | |
1768 | IN CHAR16 *Name,\r | |
1769 | IN EFI_GUID *VendorGuid\r | |
1770 | );\r | |
1771 | \r | |
93e3992d | 1772 | //\r |
1773 | // Global variable in this program (defined in data.c)\r | |
1774 | //\r | |
1775 | extern BM_MENU_OPTION BootOptionMenu;\r | |
1776 | extern BM_MENU_OPTION DriverOptionMenu;\r | |
1777 | extern BM_MENU_OPTION FsOptionMenu;\r | |
1778 | extern BM_MENU_OPTION ConsoleInpMenu;\r | |
1779 | extern BM_MENU_OPTION ConsoleOutMenu;\r | |
1780 | extern BM_MENU_OPTION ConsoleErrMenu;\r | |
1781 | extern BM_MENU_OPTION DirectoryMenu;\r | |
1782 | extern BM_MENU_OPTION DriverMenu;\r | |
1783 | extern BM_MENU_OPTION TerminalMenu;\r | |
1784 | extern BM_MENU_OPTION LegacyFDMenu;\r | |
1785 | extern BM_MENU_OPTION LegacyHDMenu;\r | |
1786 | extern BM_MENU_OPTION LegacyCDMenu;\r | |
1787 | extern BM_MENU_OPTION LegacyNETMenu;\r | |
1788 | extern BM_MENU_OPTION LegacyBEVMenu;\r | |
1789 | extern UINT16 TerminalType[];\r | |
1790 | extern COM_ATTR BaudRateList[19];\r | |
1791 | extern COM_ATTR DataBitsList[4];\r | |
1792 | extern COM_ATTR ParityList[5];\r | |
1793 | extern COM_ATTR StopBitsList[3];\r | |
dce655e8 | 1794 | extern EFI_GUID TerminalTypeGuid[4];\r |
93e3992d | 1795 | extern EFI_HII_UPDATE_DATA gUpdateData;\r |
1796 | extern STRING_DEPOSITORY *FileOptionStrDepository;\r | |
1797 | extern STRING_DEPOSITORY *ConsoleOptionStrDepository;\r | |
1798 | extern STRING_DEPOSITORY *BootOptionStrDepository;\r | |
1799 | extern STRING_DEPOSITORY *BootOptionHelpStrDepository;\r | |
1800 | extern STRING_DEPOSITORY *DriverOptionStrDepository;\r | |
1801 | extern STRING_DEPOSITORY *DriverOptionHelpStrDepository;\r | |
1802 | extern STRING_DEPOSITORY *TerminalStrDepository;\r | |
1803 | extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];\r | |
1804 | extern EFI_GUID EfiLegacyDevOrderGuid;\r | |
1805 | \r | |
1806 | #endif\r |