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