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