]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
UiApp: Update copyright info, cover old code existed in old BdsDxe driver.
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / BootMaint / BootMaint.h
1 /** @file
2 Header file for boot maintenance module.
3
4 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _BOOT_MAINT_H_
16 #define _BOOT_MAINT_H_
17
18 #include "Ui.h"
19 #include "FormGuid.h"
20 #include "FrontPage.h"
21
22 //
23 // Constants which are variable names used to access variables
24 //
25
26 #define VAR_CON_OUT_MODE L"ConOutMode"
27
28
29 //
30 // String Contant
31 //
32 #define STR_FLOPPY L"Floppy Drive #%02x"
33 #define STR_HARDDISK L"HardDisk Drive #%02x"
34 #define STR_CDROM L"ATAPI CDROM Drive #%02x"
35 #define STR_NET L"NET Drive #%02x"
36 #define STR_BEV L"BEV Drive #%02x"
37 #define STR_FLOPPY_HELP L"Select Floppy Drive #%02x"
38 #define STR_HARDDISK_HELP L"Select HardDisk Drive #%02x"
39 #define STR_CDROM_HELP L"Select ATAPI CDROM Drive #%02x"
40 #define STR_NET_HELP L"NET Drive #%02x"
41 #define STR_BEV_HELP L"BEV Drive #%02x"
42
43 //
44 // Variable created with this flag will be "Efi:...."
45 //
46 #define VAR_FLAG EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE
47
48 extern EFI_GUID mBootMaintGuid;
49 extern EFI_GUID mFileExplorerGuid;
50 extern CHAR16 mFileExplorerStorageName[];
51 extern CHAR16 mBootMaintStorageName[];
52 //
53 // These are the VFR compiler generated data representing our VFR data.
54 //
55 extern UINT8 BmBin[];
56 extern UINT8 FEBin[];
57
58 //
59 // Below are the number of options in Baudrate, Databits,
60 // Parity and Stopbits selection for serial ports.
61 //
62 #define BM_COM_ATTR_BUADRATE 19
63 #define BM_COM_ATTR_DATABITS 4
64 #define BM_COM_ATTR_PARITY 5
65 #define BM_COM_ATTR_STOPBITS 3
66
67 //
68 // Callback function helper
69 //
70 #define BMM_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('C', 'b', 'c', 'k')
71 #define BMM_CALLBACK_DATA_FROM_THIS(a) CR (a, BMM_CALLBACK_DATA, BmmConfigAccess, BMM_CALLBACK_DATA_SIGNATURE)
72
73 #define FE_CALLBACK_DATA_FROM_THIS(a) CR (a, BMM_CALLBACK_DATA, FeConfigAccess, BMM_CALLBACK_DATA_SIGNATURE)
74
75 //
76 // Enumeration type definition
77 //
78 typedef UINT8 BBS_TYPE;
79
80 typedef enum _TYPE_OF_TERMINAL {
81 TerminalTypePcAnsi = 0,
82 TerminalTypeVt100,
83 TerminalTypeVt100Plus,
84 TerminalTypeVtUtf8
85 } TYPE_OF_TERMINAL;
86
87 typedef enum _FILE_EXPLORER_STATE {
88 FileExplorerStateInActive = 0,
89 FileExplorerStateBootFromFile,
90 FileExplorerStateAddBootOption,
91 FileExplorerStateAddDriverOptionState,
92 FileExplorerStateUnknown
93 } FILE_EXPLORER_STATE;
94
95 typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
96 FileExplorerDisplayFileSystem,
97 FileExplorerDisplayDirectory,
98 FileExplorerDisplayUnknown
99 } FILE_EXPLORER_DISPLAY_CONTEXT;
100
101 //
102 // All of the signatures that will be used in list structure
103 //
104 #define BM_MENU_OPTION_SIGNATURE SIGNATURE_32 ('m', 'e', 'n', 'u')
105 #define BM_LOAD_OPTION_SIGNATURE SIGNATURE_32 ('l', 'o', 'a', 'd')
106 #define BM_CONSOLE_OPTION_SIGNATURE SIGNATURE_32 ('c', 'n', 's', 'l')
107 #define BM_FILE_OPTION_SIGNATURE SIGNATURE_32 ('f', 'i', 'l', 'e')
108 #define BM_HANDLE_OPTION_SIGNATURE SIGNATURE_32 ('h', 'n', 'd', 'l')
109 #define BM_TERMINAL_OPTION_SIGNATURE SIGNATURE_32 ('t', 'r', 'm', 'l')
110 #define BM_MENU_ENTRY_SIGNATURE SIGNATURE_32 ('e', 'n', 't', 'r')
111
112 #define BM_LOAD_CONTEXT_SELECT 0x0
113 #define BM_CONSOLE_CONTEXT_SELECT 0x1
114 #define BM_FILE_CONTEXT_SELECT 0x2
115 #define BM_HANDLE_CONTEXT_SELECT 0x3
116 #define BM_TERMINAL_CONTEXT_SELECT 0x5
117
118 #define BM_CONSOLE_IN_CONTEXT_SELECT 0x6
119 #define BM_CONSOLE_OUT_CONTEXT_SELECT 0x7
120 #define BM_CONSOLE_ERR_CONTEXT_SELECT 0x8
121
122 //
123 // Buffer size for update data
124 //
125 #define UPDATE_DATA_SIZE 0x100000
126
127 //
128 // Namespace of callback keys used in display and file system navigation
129 //
130 #define MAX_BBS_OFFSET 0xE000
131 #define NET_OPTION_OFFSET 0xD800
132 #define BEV_OPTION_OFFSET 0xD000
133 #define FD_OPTION_OFFSET 0xC000
134 #define HD_OPTION_OFFSET 0xB000
135 #define CD_OPTION_OFFSET 0xA000
136 #define FILE_OPTION_OFFSET 0x8000
137 #define FILE_OPTION_MASK 0x7FFF
138 #define HANDLE_OPTION_OFFSET 0x7000
139 #define CONSOLE_OPTION_OFFSET 0x6000
140 #define TERMINAL_OPTION_OFFSET 0x5000
141 #define CONFIG_OPTION_OFFSET 0x1200
142 #define KEY_VALUE_OFFSET 0x1100
143 #define FORM_ID_OFFSET 0x1000
144
145 //
146 // VarOffset that will be used to create question
147 // all these values are computed from the structure
148 // defined below
149 //
150 #define VAR_OFFSET(Field) ((UINT16) ((UINTN) &(((BMM_FAKE_NV_DATA *) 0)->Field)))
151
152 //
153 // Question Id of Zero is invalid, so add an offset to it
154 //
155 #define QUESTION_ID(Field) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET)
156
157 #define BOOT_TIME_OUT_VAR_OFFSET VAR_OFFSET (BootTimeOut)
158 #define BOOT_NEXT_VAR_OFFSET VAR_OFFSET (BootNext)
159 #define COM1_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COM1BaudRate)
160 #define COM1_DATA_RATE_VAR_OFFSET VAR_OFFSET (COM1DataRate)
161 #define COM1_STOP_BITS_VAR_OFFSET VAR_OFFSET (COM1StopBits)
162 #define COM1_PARITY_VAR_OFFSET VAR_OFFSET (COM1Parity)
163 #define COM1_TERMINAL_VAR_OFFSET VAR_OFFSET (COM2TerminalType)
164 #define COM2_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COM2BaudRate)
165 #define COM2_DATA_RATE_VAR_OFFSET VAR_OFFSET (COM2DataRate)
166 #define COM2_STOP_BITS_VAR_OFFSET VAR_OFFSET (COM2StopBits)
167 #define COM2_PARITY_VAR_OFFSET VAR_OFFSET (COM2Parity)
168 #define COM2_TERMINAL_VAR_OFFSET VAR_OFFSET (COM2TerminalType)
169 #define DRV_ADD_HANDLE_DESC_VAR_OFFSET VAR_OFFSET (DriverAddHandleDesc)
170 #define DRV_ADD_ACTIVE_VAR_OFFSET VAR_OFFSET (DriverAddActive)
171 #define DRV_ADD_RECON_VAR_OFFSET VAR_OFFSET (DriverAddForceReconnect)
172 #define CON_IN_COM1_VAR_OFFSET VAR_OFFSET (ConsoleInputCOM1)
173 #define CON_IN_COM2_VAR_OFFSET VAR_OFFSET (ConsoleInputCOM2)
174 #define CON_OUT_COM1_VAR_OFFSET VAR_OFFSET (ConsoleOutputCOM1)
175 #define CON_OUT_COM2_VAR_OFFSET VAR_OFFSET (ConsoleOutputCOM2)
176 #define CON_ERR_COM1_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM1)
177 #define CON_ERR_COM2_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM2)
178 #define CON_MODE_VAR_OFFSET VAR_OFFSET (ConsoleOutMode)
179 #define CON_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleCheck)
180 #define BOOT_OPTION_ORDER_VAR_OFFSET VAR_OFFSET (BootOptionOrder)
181 #define DRIVER_OPTION_ORDER_VAR_OFFSET VAR_OFFSET (DriverOptionOrder)
182 #define BOOT_OPTION_DEL_VAR_OFFSET VAR_OFFSET (BootOptionDel)
183 #define DRIVER_OPTION_DEL_VAR_OFFSET VAR_OFFSET (DriverOptionDel)
184 #define DRIVER_ADD_OPTION_VAR_OFFSET VAR_OFFSET (DriverAddHandleOptionalData)
185 #define COM_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COMBaudRate)
186 #define COM_DATA_RATE_VAR_OFFSET VAR_OFFSET (COMDataRate)
187 #define COM_STOP_BITS_VAR_OFFSET VAR_OFFSET (COMStopBits)
188 #define COM_PARITY_VAR_OFFSET VAR_OFFSET (COMParity)
189 #define COM_TERMINAL_VAR_OFFSET VAR_OFFSET (COMTerminalType)
190
191 #define BOOT_TIME_OUT_QUESTION_ID QUESTION_ID (BootTimeOut)
192 #define BOOT_NEXT_QUESTION_ID QUESTION_ID (BootNext)
193 #define COM1_BAUD_RATE_QUESTION_ID QUESTION_ID (COM1BaudRate)
194 #define COM1_DATA_RATE_QUESTION_ID QUESTION_ID (COM1DataRate)
195 #define COM1_STOP_BITS_QUESTION_ID QUESTION_ID (COM1StopBits)
196 #define COM1_PARITY_QUESTION_ID QUESTION_ID (COM1Parity)
197 #define COM1_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)
198 #define COM2_BAUD_RATE_QUESTION_ID QUESTION_ID (COM2BaudRate)
199 #define COM2_DATA_RATE_QUESTION_ID QUESTION_ID (COM2DataRate)
200 #define COM2_STOP_BITS_QUESTION_ID QUESTION_ID (COM2StopBits)
201 #define COM2_PARITY_QUESTION_ID QUESTION_ID (COM2Parity)
202 #define COM2_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)
203 #define DRV_ADD_HANDLE_DESC_QUESTION_ID QUESTION_ID (DriverAddHandleDesc)
204 #define DRV_ADD_ACTIVE_QUESTION_ID QUESTION_ID (DriverAddActive)
205 #define DRV_ADD_RECON_QUESTION_ID QUESTION_ID (DriverAddForceReconnect)
206 #define CON_IN_COM1_QUESTION_ID QUESTION_ID (ConsoleInputCOM1)
207 #define CON_IN_COM2_QUESTION_ID QUESTION_ID (ConsoleInputCOM2)
208 #define CON_OUT_COM1_QUESTION_ID QUESTION_ID (ConsoleOutputCOM1)
209 #define CON_OUT_COM2_QUESTION_ID QUESTION_ID (ConsoleOutputCOM2)
210 #define CON_ERR_COM1_QUESTION_ID QUESTION_ID (ConsoleErrorCOM1)
211 #define CON_ERR_COM2_QUESTION_ID QUESTION_ID (ConsoleErrorCOM2)
212 #define CON_MODE_QUESTION_ID QUESTION_ID (ConsoleOutMode)
213 #define CON_DEVICE_QUESTION_ID QUESTION_ID (ConsoleCheck)
214 #define BOOT_OPTION_ORDER_QUESTION_ID QUESTION_ID (BootOptionOrder)
215 #define DRIVER_OPTION_ORDER_QUESTION_ID QUESTION_ID (DriverOptionOrder)
216 #define BOOT_OPTION_DEL_QUESTION_ID QUESTION_ID (BootOptionDel)
217 #define DRIVER_OPTION_DEL_QUESTION_ID QUESTION_ID (DriverOptionDel)
218 #define DRIVER_ADD_OPTION_QUESTION_ID QUESTION_ID (DriverAddHandleOptionalData)
219 #define COM_BAUD_RATE_QUESTION_ID QUESTION_ID (COMBaudRate)
220 #define COM_DATA_RATE_QUESTION_ID QUESTION_ID (COMDataRate)
221 #define COM_STOP_BITS_QUESTION_ID QUESTION_ID (COMStopBits)
222 #define COM_PARITY_QUESTION_ID QUESTION_ID (COMParity)
223 #define COM_TERMINAL_QUESTION_ID QUESTION_ID (COMTerminalType)
224
225 #define STRING_DEPOSITORY_NUMBER 8
226
227 ///
228 /// Serial Ports attributes, first one is the value for
229 /// return from callback function, stringtoken is used to
230 /// display the value properly
231 ///
232 typedef struct {
233 UINTN Value;
234 UINT16 StringToken;
235 } COM_ATTR;
236
237 typedef struct {
238 UINT64 BaudRate;
239 UINT8 DataBits;
240 UINT8 Parity;
241 UINT8 StopBits;
242
243 UINT8 BaudRateIndex;
244 UINT8 DataBitsIndex;
245 UINT8 ParityIndex;
246 UINT8 StopBitsIndex;
247
248 UINT8 IsConIn;
249 UINT8 IsConOut;
250 UINT8 IsStdErr;
251 UINT8 TerminalType;
252
253 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
254 } BM_TERMINAL_CONTEXT;
255
256 typedef struct {
257 BOOLEAN IsBootNext;
258 BOOLEAN LoadOptionModified;
259 BOOLEAN Deleted;
260
261 BOOLEAN IsLegacy;
262 BOOLEAN IsActive;
263 BOOLEAN ForceReconnect;
264 UINTN OptionalDataSize;
265
266 UINTN LoadOptionSize;
267 UINT8 *LoadOption;
268
269 UINT32 Attributes;
270 UINT16 FilePathListLength;
271 UINT16 *Description;
272 EFI_DEVICE_PATH_PROTOCOL *FilePathList;
273 UINT8 *OptionalData;
274
275 UINT16 BbsIndex;
276 } BM_LOAD_CONTEXT;
277
278 typedef struct {
279
280 BOOLEAN IsActive;
281
282 BOOLEAN IsTerminal;
283
284 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
285 } BM_CONSOLE_CONTEXT;
286
287 typedef struct {
288 UINTN Column;
289 UINTN Row;
290 } CONSOLE_OUT_MODE;
291
292 typedef struct {
293 EFI_HANDLE Handle;
294 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
295 EFI_FILE_HANDLE FHandle;
296 UINT16 *FileName;
297 EFI_FILE_SYSTEM_VOLUME_LABEL *Info;
298
299 BOOLEAN IsRoot;
300 BOOLEAN IsDir;
301 BOOLEAN IsRemovableMedia;
302 BOOLEAN IsLoadFile;
303 BOOLEAN IsBootLegacy;
304 } BM_FILE_CONTEXT;
305
306 typedef struct {
307 EFI_HANDLE Handle;
308 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
309 } BM_HANDLE_CONTEXT;
310
311 typedef struct {
312 UINTN Signature;
313 LIST_ENTRY Head;
314 UINTN MenuNumber;
315 } BM_MENU_OPTION;
316
317 typedef struct {
318 UINTN Signature;
319 LIST_ENTRY Link;
320 UINTN OptionNumber;
321 UINT16 *DisplayString;
322 UINT16 *HelpString;
323 EFI_STRING_ID DisplayStringToken;
324 EFI_STRING_ID HelpStringToken;
325 UINTN ContextSelection;
326 VOID *VariableContext;
327 } BM_MENU_ENTRY;
328
329 typedef struct {
330 //
331 // Shared callback data.
332 //
333 UINTN Signature;
334
335 BM_MENU_ENTRY *MenuEntry;
336 BM_HANDLE_CONTEXT *HandleContext;
337 BM_FILE_CONTEXT *FileContext;
338 BM_LOAD_CONTEXT *LoadContext;
339 BM_TERMINAL_CONTEXT *TerminalContext;
340 UINTN CurrentTerminal;
341 BBS_TYPE BbsType;
342
343 //
344 // BMM main formset callback data.
345 //
346 EFI_HII_HANDLE BmmHiiHandle;
347 EFI_HANDLE BmmDriverHandle;
348 EFI_HII_CONFIG_ACCESS_PROTOCOL BmmConfigAccess;
349 EFI_FORM_ID BmmCurrentPageId;
350 EFI_FORM_ID BmmPreviousPageId;
351 BOOLEAN BmmAskSaveOrNot;
352 BMM_FAKE_NV_DATA BmmFakeNvData;
353 BMM_FAKE_NV_DATA BmmOldFakeNVData;
354
355 //
356 // File explorer formset callback data.
357 //
358 EFI_HII_HANDLE FeHiiHandle;
359 EFI_HANDLE FeDriverHandle;
360 EFI_HII_CONFIG_ACCESS_PROTOCOL FeConfigAccess;
361 FILE_EXPLORER_STATE FeCurrentState;
362 FILE_EXPLORER_DISPLAY_CONTEXT FeDisplayContext;
363 FILE_EXPLORER_NV_DATA FeFakeNvData;
364 } BMM_CALLBACK_DATA;
365
366 typedef struct _STRING_LIST_NODE STRING_LIST_NODE;
367
368 struct _STRING_LIST_NODE {
369 EFI_STRING_ID StringToken;
370 STRING_LIST_NODE *Next;
371 };
372
373 typedef struct _STRING_DEPOSITORY {
374 UINTN TotalNodeNumber;
375 STRING_LIST_NODE *CurrentNode;
376 STRING_LIST_NODE *ListHead;
377 } STRING_DEPOSITORY;
378
379 //
380 // #pragma pack()
381 //
382 // For initializing File System menu
383 //
384
385 /**
386 This function build the FsOptionMenu list which records all
387 available file system in the system. They includes all instances
388 of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, all instances of EFI_LOAD_FILE_SYSTEM
389 and all type of legacy boot device.
390
391 @param CallbackData BMM context data
392
393 @retval EFI_SUCCESS Success find the file system
394 @retval EFI_OUT_OF_RESOURCES Can not create menu entry
395
396 **/
397 EFI_STATUS
398 BOpt_FindFileSystem (
399 IN BMM_CALLBACK_DATA *CallbackData
400 );
401
402 /**
403 Find files under current directory
404 All files and sub-directories in current directory
405 will be stored in DirectoryMenu for future use.
406
407 @param CallbackData The BMM context data.
408 @param MenuEntry The Menu Entry.
409
410 @retval EFI_SUCCESS Get files from current dir successfully.
411 @return Other value if can't get files from current dir.
412
413 **/
414 EFI_STATUS
415 BOpt_FindFiles (
416 IN BMM_CALLBACK_DATA *CallbackData,
417 IN BM_MENU_ENTRY *MenuEntry
418 );
419
420 /**
421
422 Find drivers that will be added as Driver#### variables from handles
423 in current system environment
424 All valid handles in the system except those consume SimpleFs, LoadFile
425 are stored in DriverMenu for future use.
426
427 @retval EFI_SUCCESS The function complets successfully.
428 @return Other value if failed to build the DriverMenu.
429
430 **/
431 EFI_STATUS
432 BOpt_FindDrivers (
433 VOID
434 );
435
436 /**
437
438 Build the BootOptionMenu according to BootOrder Variable.
439 This Routine will access the Boot#### to get EFI_LOAD_OPTION.
440
441 @param CallbackData The BMM context data.
442
443 @return The number of the Var Boot####.
444
445 **/
446 EFI_STATUS
447 BOpt_GetBootOptions (
448 IN BMM_CALLBACK_DATA *CallbackData
449 );
450
451 /**
452
453 Build up all DriverOptionMenu
454
455 @param CallbackData The BMM context data.
456
457 @return EFI_SUCESS The functin completes successfully.
458 @retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.
459
460
461 **/
462 EFI_STATUS
463 BOpt_GetDriverOptions (
464 IN BMM_CALLBACK_DATA *CallbackData
465 );
466
467 /**
468 Free resources allocated in Allocate Rountine.
469
470 @param FreeMenu Menu to be freed
471
472 **/
473 VOID
474 BOpt_FreeMenu (
475 BM_MENU_OPTION *FreeMenu
476 );
477
478
479 /**
480
481 Append file name to existing file name.
482
483 @param Str1 The existing file name
484 @param Str2 The file name to be appended
485
486 @return Allocate a new string to hold the appended result.
487 Caller is responsible to free the returned string.
488
489 **/
490 CHAR16*
491 BOpt_AppendFileName (
492 IN CHAR16 *Str1,
493 IN CHAR16 *Str2
494 );
495
496 /**
497
498 Check whether current FileName point to a valid
499 Efi Image File.
500
501 @param FileName File need to be checked.
502
503 @retval TRUE Is Efi Image
504 @retval FALSE Not a valid Efi Image
505
506 **/
507 BOOLEAN
508 BOpt_IsEfiImageName (
509 IN UINT16 *FileName
510 );
511
512 /**
513
514 Check whether current FileName point to a valid Efi Application
515
516 @param Dir Pointer to current Directory
517 @param FileName Pointer to current File name.
518
519 @retval TRUE Is a valid Efi Application
520 @retval FALSE not a valid Efi Application
521
522 **/
523 BOOLEAN
524 BOpt_IsEfiApp (
525 IN EFI_FILE_HANDLE Dir,
526 IN UINT16 *FileName
527 );
528
529 /**
530
531 Get the Option Number that has not been allocated for use.
532
533 @param Type The type of Option.
534
535 @return The available Option Number.
536
537 **/
538 UINT16
539 BOpt_GetOptionNumber (
540 CHAR16 *Type
541 );
542
543 /**
544
545 Get the Option Number for Boot#### that does not used.
546
547 @return The available Option Number.
548
549 **/
550 UINT16
551 BOpt_GetBootOptionNumber (
552 VOID
553 );
554
555 /**
556
557 Get the Option Number for Driver#### that does not used.
558
559 @return The unused Option Number.
560
561 **/
562 UINT16
563 BOpt_GetDriverOptionNumber (
564 VOID
565 );
566
567 /**
568 Create a menu entry give a Menu type.
569
570 @param MenuType The Menu type to be created.
571
572
573 @retval NULL If failed to create the menu.
574 @return The menu.
575
576 **/
577 BM_MENU_ENTRY *
578 BOpt_CreateMenuEntry (
579 UINTN MenuType
580 );
581
582 /**
583 Free up all resource allocated for a BM_MENU_ENTRY.
584
585 @param MenuEntry A pointer to BM_MENU_ENTRY.
586
587 **/
588 VOID
589 BOpt_DestroyMenuEntry (
590 BM_MENU_ENTRY *MenuEntry
591 );
592
593 /**
594 Get the Menu Entry from the list in Menu Entry List.
595
596 If MenuNumber is great or equal to the number of Menu
597 Entry in the list, then ASSERT.
598
599 @param MenuOption The Menu Entry List to read the menu entry.
600 @param MenuNumber The index of Menu Entry.
601
602 @return The Menu Entry.
603
604 **/
605 BM_MENU_ENTRY *
606 BOpt_GetMenuEntry (
607 BM_MENU_OPTION *MenuOption,
608 UINTN MenuNumber
609 );
610
611 /**
612 Get option number according to Boot#### and BootOrder variable.
613 The value is saved as #### + 1.
614
615 @param CallbackData The BMM context data.
616 **/
617 VOID
618 GetBootOrder (
619 IN BMM_CALLBACK_DATA *CallbackData
620 );
621
622 /**
623 Get driver option order from globalc DriverOptionMenu.
624
625 @param CallbackData The BMM context data.
626
627 **/
628 VOID
629 GetDriverOrder (
630 IN BMM_CALLBACK_DATA *CallbackData
631 );
632
633 //
634 // Locate all serial io devices for console
635 //
636 /**
637 Build a list containing all serial devices.
638
639 @retval EFI_SUCCESS The function complete successfully.
640 @retval EFI_UNSUPPORTED No serial ports present.
641
642 **/
643 EFI_STATUS
644 LocateSerialIo (
645 VOID
646 );
647
648 //
649 // Initializing Console menu
650 //
651 /**
652 Build up ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
653
654 @retval EFI_SUCCESS The function always complete successfully.
655
656 **/
657 EFI_STATUS
658 GetAllConsoles(
659 VOID
660 );
661
662 //
663 // Get current mode information
664 //
665 /**
666 Get mode number according to column and row
667
668 @param CallbackData The BMM context data.
669 **/
670 VOID
671 GetConsoleOutMode (
672 IN BMM_CALLBACK_DATA *CallbackData
673 );
674
675 //
676 // Cleaning up console menu
677 //
678 /**
679 Free ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
680
681 @retval EFI_SUCCESS The function always complete successfully.
682 **/
683 EFI_STATUS
684 FreeAllConsoles (
685 VOID
686 );
687
688 /**
689 Update the device path that describing a terminal device
690 based on the new BaudRate, Data Bits, parity and Stop Bits
691 set.
692
693 @param DevicePath The devicepath protocol instance wanted to be updated.
694
695 **/
696 VOID
697 ChangeVariableDevicePath (
698 IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath
699 );
700
701 /**
702 Update the multi-instance device path of Terminal Device based on
703 the global TerminalMenu. If ChangeTernimal is TRUE, the terminal
704 device path in the Terminal Device in TerminalMenu is also updated.
705
706 @param DevicePath The multi-instance device path.
707 @param ChangeTerminal TRUE, then device path in the Terminal Device
708 in TerminalMenu is also updated; FALSE, no update.
709
710 @return EFI_SUCCESS The function completes successfully.
711
712 **/
713 EFI_STATUS
714 ChangeTerminalDevicePath (
715 IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath,
716 IN BOOLEAN ChangeTerminal
717 );
718
719 //
720 // Variable operation by menu selection
721 //
722 /**
723 This function create a currently loaded Boot Option from
724 the BMM. It then appends this Boot Option to the end of
725 the "BootOrder" list. It also append this Boot Opotion to the end
726 of BootOptionMenu.
727
728 @param CallbackData The BMM context data.
729 @param NvRamMap The file explorer formset internal state.
730
731 @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
732 @retval EFI_SUCCESS If function completes successfully.
733
734 **/
735 EFI_STATUS
736 Var_UpdateBootOption (
737 IN BMM_CALLBACK_DATA *CallbackData,
738 IN FILE_EXPLORER_NV_DATA *NvRamMap
739 );
740
741 /**
742 Delete Boot Option that represent a Deleted state in BootOptionMenu.
743 After deleting this boot option, call Var_ChangeBootOrder to
744 make sure BootOrder is in valid state.
745
746 @retval EFI_SUCCESS If all boot load option EFI Variables corresponding to
747 BM_LOAD_CONTEXT marked for deletion is deleted
748 @return Others If failed to update the "BootOrder" variable after deletion.
749
750 **/
751 EFI_STATUS
752 Var_DelBootOption (
753 VOID
754 );
755
756 /**
757 After any operation on Boot####, there will be a discrepancy in BootOrder.
758 Since some are missing but in BootOrder, while some are present but are
759 not reflected by BootOrder. Then a function rebuild BootOrder from
760 scratch by content from BootOptionMenu is needed.
761
762 @retval EFI_SUCCESS The boot order is updated successfully.
763 @return other than EFI_SUCCESS if failed to change the "BootOrder" EFI Variable.
764
765 **/
766 EFI_STATUS
767 Var_ChangeBootOrder (
768 VOID
769 );
770
771 /**
772 This function create a currently loaded Drive Option from
773 the BMM. It then appends this Driver Option to the end of
774 the "DriverOrder" list. It append this Driver Opotion to the end
775 of DriverOptionMenu.
776
777 @param CallbackData The BMM context data.
778 @param HiiHandle The HII handle associated with the BMM formset.
779 @param DescriptionData The description of this driver option.
780 @param OptionalData The optional load option.
781 @param ForceReconnect If to force reconnect.
782
783 @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
784 @retval EFI_SUCCESS If function completes successfully.
785
786 **/
787 EFI_STATUS
788 Var_UpdateDriverOption (
789 IN BMM_CALLBACK_DATA *CallbackData,
790 IN EFI_HII_HANDLE HiiHandle,
791 IN UINT16 *DescriptionData,
792 IN UINT16 *OptionalData,
793 IN UINT8 ForceReconnect
794 );
795
796 /**
797 Delete Load Option that represent a Deleted state in BootOptionMenu.
798 After deleting this Driver option, call Var_ChangeDriverOrder to
799 make sure DriverOrder is in valid state.
800
801 @retval EFI_SUCCESS Load Option is successfully updated.
802 @return Other value than EFI_SUCCESS if failed to update "Driver Order" EFI
803 Variable.
804
805 **/
806 EFI_STATUS
807 Var_DelDriverOption (
808 VOID
809 );
810
811 /**
812 After any operation on Driver####, there will be a discrepancy in
813 DriverOrder. Since some are missing but in DriverOrder, while some
814 are present but are not reflected by DriverOrder. Then a function
815 rebuild DriverOrder from scratch by content from DriverOptionMenu is
816 needed.
817
818 @retval EFI_SUCCESS The driver order is updated successfully.
819 @return other than EFI_SUCCESS if failed to set the "DriverOrder" EFI Variable.
820
821 **/
822 EFI_STATUS
823 Var_ChangeDriverOrder (
824 VOID
825 );
826
827 /**
828 This function delete and build multi-instance device path ConIn
829 console device.
830
831 @retval EFI_SUCCESS The function complete successfully.
832 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
833 **/
834 EFI_STATUS
835 Var_UpdateConsoleInpOption (
836 VOID
837 );
838
839 /**
840 This function delete and build multi-instance device path ConOut console device.
841
842 @retval EFI_SUCCESS The function complete successfully.
843 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
844 **/
845 EFI_STATUS
846 Var_UpdateConsoleOutOption (
847 VOID
848 );
849
850 /**
851 This function delete and build multi-instance device path ErrOut console device.
852
853 @retval EFI_SUCCESS The function complete successfully.
854 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
855 **/
856 EFI_STATUS
857 Var_UpdateErrorOutOption (
858 VOID
859 );
860
861 /**
862 This function delete and build Out of Band console device.
863
864 @param MenuIndex Menu index which user select in the terminal menu list.
865
866 @retval EFI_SUCCESS The function complete successfully.
867 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
868 **/
869 EFI_STATUS
870 Var_UpdateOutOfBandOption (
871 IN UINT16 MenuIndex
872 );
873
874 /**
875 Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new BaudRate, Data Bits,
876 parity and stop Bits set.
877
878 **/
879 VOID
880 Var_UpdateAllConsoleOption (
881 VOID
882 );
883
884 /**
885 This function update the "BootNext" EFI Variable. If there is no "BootNex" specified in BMM,
886 this EFI Variable is deleted.
887 It also update the BMM context data specified the "BootNext" value.
888
889 @param CallbackData The BMM context data.
890
891 @retval EFI_SUCCESS The function complete successfully.
892 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
893
894 **/
895 EFI_STATUS
896 Var_UpdateBootNext (
897 IN BMM_CALLBACK_DATA *CallbackData
898 );
899
900 /**
901 This function update the "BootOrder" EFI Variable based on BMM Formset's NV map. It then refresh
902 BootOptionMenu with the new "BootOrder" list.
903
904 @param CallbackData The BMM context data.
905
906 @retval EFI_SUCCESS The function complete successfully.
907 @retval EFI_OUT_OF_RESOURCES Not enough memory to complete the function.
908 @return not The EFI variable can not be saved. See gRT->SetVariable for detail return information.
909
910 **/
911 EFI_STATUS
912 Var_UpdateBootOrder (
913 IN BMM_CALLBACK_DATA *CallbackData
914 );
915
916 /**
917 This function update the "DriverOrder" EFI Variable based on
918 BMM Formset's NV map. It then refresh DriverOptionMenu
919 with the new "DriverOrder" list.
920
921 @param CallbackData The BMM context data.
922
923 @retval EFI_SUCCESS The function complete successfully.
924 @retval EFI_OUT_OF_RESOURCES Not enough memory to complete the function.
925 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
926
927 **/
928 EFI_STATUS
929 Var_UpdateDriverOrder (
930 IN BMM_CALLBACK_DATA *CallbackData
931 );
932
933 /**
934 Update the Text Mode of Console.
935
936 @param CallbackData The context data for BMM.
937
938 @retval EFI_SUCCSS If the Text Mode of Console is updated.
939 @return Other value if the Text Mode of Console is not updated.
940
941 **/
942 EFI_STATUS
943 Var_UpdateConMode (
944 IN BMM_CALLBACK_DATA *CallbackData
945 );
946
947 //
948 // Following are page create and refresh functions
949 //
950 /**
951 Refresh the global UpdateData structure.
952
953 **/
954 VOID
955 RefreshUpdateData (
956 VOID
957 );
958
959 /**
960 Clean up the dynamic opcode at label and form specified by
961 both LabelId.
962
963 @param LabelId It is both the Form ID and Label ID for
964 opcode deletion.
965 @param CallbackData The BMM context data.
966
967 **/
968 VOID
969 CleanUpPage (
970 IN UINT16 LabelId,
971 IN BMM_CALLBACK_DATA *CallbackData
972 );
973
974 /**
975 Create a lit of boot option from global BootOptionMenu. It
976 allow user to delete the boot option.
977
978 @param CallbackData The BMM context data.
979
980 **/
981 VOID
982 UpdateBootDelPage (
983 IN BMM_CALLBACK_DATA *CallbackData
984 );
985
986 /**
987 Create a lit of driver option from global DriverMenu.
988
989 @param CallbackData The BMM context data.
990 **/
991 VOID
992 UpdateDrvAddHandlePage (
993 IN BMM_CALLBACK_DATA *CallbackData
994 );
995
996 /**
997 Create a lit of driver option from global DriverOptionMenu. It
998 allow user to delete the driver option.
999
1000 @param CallbackData The BMM context data.
1001 **/
1002 VOID
1003 UpdateDrvDelPage (
1004 IN BMM_CALLBACK_DATA *CallbackData
1005 );
1006
1007 /**
1008 Prepare the page to allow user to add description for a Driver Option.
1009
1010 @param CallbackData The BMM context data.
1011 **/
1012 VOID
1013 UpdateDriverAddHandleDescPage (
1014 IN BMM_CALLBACK_DATA *CallbackData
1015 );
1016
1017 /**
1018 Dispatch the correct update page function to call based on the UpdatePageId.
1019
1020 @param UpdatePageId The form ID.
1021 @param CallbackData The BMM context data.
1022 **/
1023 VOID
1024 UpdatePageBody (
1025 IN UINT16 UpdatePageId,
1026 IN BMM_CALLBACK_DATA *CallbackData
1027 );
1028
1029 /**
1030 Create the dynamic page to allow user to set the "BootNext" vaule.
1031
1032 @param CallbackData The BMM context data.
1033 **/
1034 VOID
1035 UpdateBootNextPage (
1036 IN BMM_CALLBACK_DATA *CallbackData
1037 );
1038
1039 /**
1040 Create the dynamic page to allow user to set the "TimeOut" vaule.
1041
1042 @param CallbackData The BMM context data.
1043 **/
1044 VOID
1045 UpdateTimeOutPage (
1046 IN BMM_CALLBACK_DATA *CallbackData
1047 );
1048
1049 /**
1050 Create the dynamic page which allows user to set the property such as Baud Rate, Data Bits,
1051 Parity, Stop Bits, Terminal Type.
1052
1053 @param CallbackData The BMM context data.
1054 **/
1055 VOID
1056 UpdateTerminalPage (
1057 IN BMM_CALLBACK_DATA *CallbackData
1058 );
1059
1060 /**
1061 Refresh the text mode page
1062
1063 @param CallbackData The BMM context data.
1064 **/
1065 VOID
1066 UpdateConModePage (
1067 IN BMM_CALLBACK_DATA *CallbackData
1068 );
1069
1070 /**
1071 Create a list of Goto Opcode for all terminal devices logged
1072 by TerminaMenu. This list will be inserted to form FORM_CON_COM_SETUP_ID.
1073
1074 @param CallbackData The BMM context data.
1075 **/
1076 VOID
1077 UpdateConCOMPage (
1078 IN BMM_CALLBACK_DATA *CallbackData
1079 );
1080
1081 /**
1082 Function opens and returns a file handle to the root directory of a volume.
1083
1084 @param DeviceHandle A handle for a device
1085 @return A valid file handle or NULL is returned
1086 **/
1087 EFI_FILE_HANDLE
1088 EfiLibOpenRoot (
1089 IN EFI_HANDLE DeviceHandle
1090 );
1091
1092 /**
1093 Function gets the file system information from an open file descriptor,
1094 and stores it in a buffer allocated from pool.
1095
1096 @param FHand The file handle.
1097
1098 @return A pointer to a buffer with file information.
1099 NULL is returned if failed to get Vaolume Label Info.
1100 **/
1101 EFI_FILE_SYSTEM_VOLUME_LABEL *
1102 EfiLibFileSystemVolumeLabelInfo (
1103 IN EFI_FILE_HANDLE FHand
1104 );
1105
1106 /**
1107
1108 Function gets the file information from an open file descriptor, and stores it
1109 in a buffer allocated from pool.
1110
1111 @param FHand File Handle.
1112
1113 @return A pointer to a buffer with file information or NULL is returned
1114
1115 **/
1116 EFI_FILE_INFO *
1117 EfiLibFileInfo (
1118 IN EFI_FILE_HANDLE FHand
1119 );
1120
1121 /**
1122 Find the first instance of this Protocol in the system and return it's interface.
1123
1124 @param ProtocolGuid Provides the protocol to search for
1125 @param Interface On return, a pointer to the first interface
1126 that matches ProtocolGuid
1127
1128 @retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found
1129 @retval EFI_NOT_FOUND No protocol instances were found that match ProtocolGuid
1130
1131 **/
1132 EFI_STATUS
1133 EfiLibLocateProtocol (
1134 IN EFI_GUID *ProtocolGuid,
1135 OUT VOID **Interface
1136 );
1137
1138 /**
1139 Adjusts the size of a previously allocated buffer.
1140
1141 @param OldPool A pointer to the buffer whose size is being adjusted.
1142 @param OldSize The size of the current buffer.
1143 @param NewSize The size of the new buffer.
1144
1145 @return The newly allocated buffer. if NULL, allocation failed.
1146
1147 **/
1148 VOID*
1149 EfiReallocatePool (
1150 IN VOID *OldPool,
1151 IN UINTN OldSize,
1152 IN UINTN NewSize
1153 );
1154
1155 /**
1156 Function deletes the variable specified by VarName and VarGuid.
1157
1158
1159 @param VarName A Null-terminated Unicode string that is
1160 the name of the vendor's variable.
1161
1162 @param VarGuid A unique identifier for the vendor.
1163
1164 @retval EFI_SUCCESS The variable was found and removed
1165 @retval EFI_UNSUPPORTED The variable store was inaccessible
1166 @retval EFI_OUT_OF_RESOURCES The temporary buffer was not available
1167 @retval EFI_NOT_FOUND The variable was not found
1168
1169 **/
1170 EFI_STATUS
1171 EfiLibDeleteVariable (
1172 IN CHAR16 *VarName,
1173 IN EFI_GUID *VarGuid
1174 );
1175
1176 /**
1177 Duplicate a string.
1178
1179 @param Src The source.
1180
1181 @return A new string which is duplicated copy of the source.
1182 @retval NULL If there is not enough memory.
1183
1184 **/
1185 CHAR16 *
1186 EfiStrDuplicate (
1187 IN CHAR16 *Src
1188 );
1189
1190 /**
1191 Function is used to determine the number of device path instances
1192 that exist in a device path.
1193
1194
1195 @param DevicePath A pointer to a device path data structure.
1196
1197 @return This function counts and returns the number of device path instances
1198 in DevicePath.
1199
1200 **/
1201 UINTN
1202 EfiDevicePathInstanceCount (
1203 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
1204 );
1205
1206 /**
1207 Create string tokens for a menu from its help strings and display strings
1208
1209
1210 @param CallbackData The BMM context data.
1211 @param HiiHandle Hii Handle of the package to be updated.
1212 @param MenuOption The Menu whose string tokens need to be created
1213
1214 @retval EFI_SUCCESS string tokens created successfully
1215 @retval others contain some errors
1216
1217 **/
1218 EFI_STATUS
1219 CreateMenuStringToken (
1220 IN BMM_CALLBACK_DATA *CallbackData,
1221 IN EFI_HII_HANDLE HiiHandle,
1222 IN BM_MENU_OPTION *MenuOption
1223 );
1224
1225 /**
1226 Get a string from the Data Hub record based on
1227 a device path.
1228
1229 @param DevPath The device Path.
1230
1231 @return A string located from the Data Hub records based on
1232 the device path.
1233 @retval NULL If failed to get the String from Data Hub.
1234
1235 **/
1236 UINT16 *
1237 EfiLibStrFromDatahub (
1238 IN EFI_DEVICE_PATH_PROTOCOL *DevPath
1239 );
1240
1241 /**
1242 Get the index number (#### in Boot####) for the boot option pointed to a BBS legacy device type
1243 specified by DeviceType.
1244
1245 @param DeviceType The legacy device type. It can be floppy, network, harddisk, cdrom,
1246 etc.
1247 @param OptionIndex Returns the index number (#### in Boot####).
1248 @param OptionSize Return the size of the Boot### variable.
1249
1250 **/
1251 VOID *
1252 GetLegacyBootOptionVar (
1253 IN UINTN DeviceType,
1254 OUT UINTN *OptionIndex,
1255 OUT UINTN *OptionSize
1256 );
1257
1258 /**
1259 Initialize the Boot Maintenance Utitliy.
1260
1261 **/
1262 VOID
1263 InitializeBM (
1264 VOID
1265 );
1266
1267
1268 /**
1269 Intialize all the string depositories.
1270
1271 **/
1272 VOID
1273 InitializeStringDepository (
1274 VOID
1275 );
1276
1277 /**
1278 Fetch a usable string node from the string depository and return the string token.
1279
1280
1281 @param CallbackData The BMM context data.
1282 @param StringDepository Pointer of the string depository.
1283
1284 @retval EFI_STRING_ID String token.
1285
1286 **/
1287 EFI_STRING_ID
1288 GetStringTokenFromDepository (
1289 IN BMM_CALLBACK_DATA *CallbackData,
1290 IN STRING_DEPOSITORY *StringDepository
1291 );
1292
1293 /**
1294 Reclaim string depositories by moving the current node pointer to list head..
1295 **/
1296 VOID
1297 ReclaimStringDepository (
1298 VOID
1299 );
1300
1301 /**
1302 Release resource for all the string depositories.
1303
1304 **/
1305 VOID
1306 CleanUpStringDepository (
1307 VOID
1308 );
1309
1310 /**
1311 Function handling request to apply changes for BMM pages.
1312
1313 @param Private Pointer to callback data buffer.
1314 @param CurrentFakeNVMap Pointer to buffer holding data of various values used by BMM
1315 @param FormId ID of the form which has sent the request to apply change.
1316
1317 @retval EFI_SUCCESS Change successfully applied.
1318 @retval Other Error occurs while trying to apply changes.
1319
1320 **/
1321 EFI_STATUS
1322 ApplyChangeHandler (
1323 IN BMM_CALLBACK_DATA *Private,
1324 IN BMM_FAKE_NV_DATA *CurrentFakeNVMap,
1325 IN EFI_FORM_ID FormId
1326 );
1327
1328 /**
1329 Discard all changes done to the BMM pages such as Boot Order change,
1330 Driver order change.
1331
1332 @param Private The BMM context data.
1333 @param CurrentFakeNVMap The current Fack NV Map.
1334
1335 **/
1336 VOID
1337 DiscardChangeHandler (
1338 IN BMM_CALLBACK_DATA *Private,
1339 IN BMM_FAKE_NV_DATA *CurrentFakeNVMap
1340 );
1341
1342 /**
1343 Dispatch the display to the next page based on NewPageId.
1344
1345 @param Private The BMM context data.
1346 @param NewPageId The original page ID.
1347
1348 **/
1349 VOID
1350 UpdatePageId (
1351 BMM_CALLBACK_DATA *Private,
1352 UINT16 NewPageId
1353 );
1354
1355 /**
1356 Boot a file selected by user at File Expoloer of BMM.
1357
1358 @param FileContext The file context data, which contains the device path
1359 of the file to be boot from.
1360
1361 @retval EFI_SUCCESS The function completed successfull.
1362 @return Other value if the boot from the file fails.
1363
1364 **/
1365 EFI_STATUS
1366 BootThisFile (
1367 IN BM_FILE_CONTEXT *FileContext
1368 );
1369
1370 /**
1371 Update the file explower page with the refershed file system.
1372
1373
1374 @param CallbackData BMM context data
1375 @param KeyValue Key value to identify the type of data to expect.
1376
1377 @retval TRUE Inform the caller to create a callback packet to exit file explorer.
1378 @retval FALSE Indicate that there is no need to exit file explorer.
1379
1380 **/
1381 BOOLEAN
1382 UpdateFileExplorer (
1383 IN BMM_CALLBACK_DATA *CallbackData,
1384 IN UINT16 KeyValue
1385 );
1386
1387 /**
1388 This function processes the results of changes in configuration.
1389 When user select a interactive opcode, this callback will be triggered.
1390 Based on the Question(QuestionId) that triggers the callback, the corresponding
1391 actions is performed. It handles:
1392
1393 1) the addition of boot option.
1394 2) the addition of driver option.
1395 3) exit from file browser
1396 4) update of file content if a dir is selected.
1397 5) boot the file if a file is selected in "boot from file"
1398
1399
1400 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
1401 @param Action Specifies the type of action taken by the browser.
1402 @param QuestionId A unique value which is sent to the original exporting driver
1403 so that it can identify the type of data to expect.
1404 @param Type The type of value for the question.
1405 @param Value A pointer to the data being sent to the original exporting driver.
1406 @param ActionRequest On return, points to the action requested by the callback function.
1407
1408 @retval EFI_SUCCESS The callback successfully handled the action.
1409 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
1410 @retval EFI_DEVICE_ERROR The variable could not be saved.
1411 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
1412
1413 **/
1414 EFI_STATUS
1415 EFIAPI
1416 FileExplorerCallback (
1417 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
1418 IN EFI_BROWSER_ACTION Action,
1419 IN EFI_QUESTION_ID QuestionId,
1420 IN UINT8 Type,
1421 IN EFI_IFR_TYPE_VALUE *Value,
1422 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
1423 );
1424
1425 /**
1426 Remove the installed BootMaint and FileExplorer HiiPackages.
1427
1428 **/
1429 VOID
1430 FreeBMPackage(
1431 VOID
1432 );
1433
1434 /**
1435 Install BootMaint and FileExplorer HiiPackages.
1436
1437 **/
1438 VOID
1439 InitBootMaintenance(
1440 VOID
1441 );
1442
1443 //
1444 // Global variable in this program (defined in data.c)
1445 //
1446 extern BM_MENU_OPTION BootOptionMenu;
1447 extern BM_MENU_OPTION DriverOptionMenu;
1448 extern BM_MENU_OPTION FsOptionMenu;
1449 extern BM_MENU_OPTION ConsoleInpMenu;
1450 extern BM_MENU_OPTION ConsoleOutMenu;
1451 extern BM_MENU_OPTION ConsoleErrMenu;
1452 extern BM_MENU_OPTION DirectoryMenu;
1453 extern BM_MENU_OPTION DriverMenu;
1454 extern BM_MENU_OPTION TerminalMenu;
1455 extern UINT16 TerminalType[];
1456 extern COM_ATTR BaudRateList[19];
1457 extern COM_ATTR DataBitsList[4];
1458 extern COM_ATTR ParityList[5];
1459 extern COM_ATTR StopBitsList[3];
1460 extern EFI_GUID TerminalTypeGuid[4];
1461 extern STRING_DEPOSITORY *FileOptionStrDepository;
1462 extern STRING_DEPOSITORY *ConsoleOptionStrDepository;
1463 extern STRING_DEPOSITORY *BootOptionStrDepository;
1464 extern STRING_DEPOSITORY *BootOptionHelpStrDepository;
1465 extern STRING_DEPOSITORY *DriverOptionStrDepository;
1466 extern STRING_DEPOSITORY *DriverOptionHelpStrDepository;
1467 extern STRING_DEPOSITORY *TerminalStrDepository;
1468 extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
1469
1470 //
1471 // Shared IFR form update data
1472 //
1473 extern VOID *mStartOpCodeHandle;
1474 extern VOID *mEndOpCodeHandle;
1475 extern EFI_IFR_GUID_LABEL *mStartLabel;
1476 extern EFI_IFR_GUID_LABEL *mEndLabel;
1477
1478 #endif