TianoCore EDK2 master
Loading...
Searching...
No Matches
UefiBootManagerLib.h
Go to the documentation of this file.
1
10#ifndef _UEFI_BOOT_MANAGER_LIB_H_
11#define _UEFI_BOOT_MANAGER_LIB_H_
12
14#include <Library/SortLib.h>
15
16//
17// Boot Manager load option library functions.
18//
19
20//
21// Load Option Type
22//
23typedef enum {
24 LoadOptionTypeDriver,
25 LoadOptionTypeSysPrep,
26 LoadOptionTypeBoot,
27 LoadOptionTypePlatformRecovery,
28 LoadOptionTypeMax
29} EFI_BOOT_MANAGER_LOAD_OPTION_TYPE;
30
31typedef enum {
32 LoadOptionNumberMax = 0x10000,
33 LoadOptionNumberUnassigned = LoadOptionNumberMax
34} EFI_BOOT_MANAGER_LOAD_OPTION_NUMBER;
35
36//
37// Common structure definition for DriverOption and BootOption
38//
39typedef struct {
40 //
41 // Data read from UEFI NV variables
42 //
43 UINTN OptionNumber; // #### numerical value, could be LoadOptionNumberUnassigned
44 EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType; // LoadOptionTypeBoot or LoadOptionTypeDriver
45 UINT32 Attributes; // Load Option Attributes
46 CHAR16 *Description; // Load Option Description
47 EFI_DEVICE_PATH_PROTOCOL *FilePath; // Load Option Device Path
48 UINT8 *OptionalData; // Load Option optional data to pass into image
49 UINT32 OptionalDataSize; // Load Option size of OptionalData
50 EFI_GUID VendorGuid;
51
52 //
53 // Used at runtime
54 //
55 EFI_STATUS Status; // Status returned from boot attempt gBS->StartImage ()
56 CHAR16 *ExitData; // Exit data returned from gBS->StartImage ()
57 UINTN ExitDataSize; // Size of ExitData
59
73EFIAPI
75 OUT UINTN *LoadOptionCount,
76 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType
77 );
78
89EFIAPI
92 IN UINTN LoadOptionCount
93 );
94
111EFIAPI
114 IN UINTN OptionNumber,
115 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType,
116 IN UINT32 Attributes,
117 IN CHAR16 *Description,
119 IN UINT8 *OptionalData,
120 IN UINT32 OptionalDataSize
121 );
122
134EFIAPI
137 );
138
151EFIAPI
153 IN CHAR16 *VariableName,
155 );
156
166EFIAPI
169 );
170
192EFIAPI
195 IN UINTN Position
196 );
197
210EFIAPI
212 IN UINTN OptionNumber,
213 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType
214 );
215
223VOID
224EFIAPI
226 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType,
227 IN SORT_COMPARE CompareFunction
228 );
229
243INTN
244EFIAPI
248 IN UINTN Count
249 );
250
251//
252// Boot Manager hot key library functions.
253//
254
255#pragma pack(1)
259typedef struct {
281 UINT16 OptionNumber;
283#pragma pack()
284
294EFIAPI
296 IN EFI_EVENT *HotkeyTriggered
297 );
298
299//
300// Modifier for EfiBootManagerAddKeyOptionVariable and EfiBootManagerDeleteKeyOptionVariable
301//
302#define EFI_BOOT_MANAGER_SHIFT_PRESSED 0x00000001
303#define EFI_BOOT_MANAGER_CONTROL_PRESSED 0x00000002
304#define EFI_BOOT_MANAGER_ALT_PRESSED 0x00000004
305#define EFI_BOOT_MANAGER_LOGO_PRESSED 0x00000008
306#define EFI_BOOT_MANAGER_MENU_KEY_PRESSED 0x00000010
307#define EFI_BOOT_MANAGER_SYS_REQ_PRESSED 0x00000020
308
322EFIAPI
324 OUT EFI_BOOT_MANAGER_KEY_OPTION *AddedOption OPTIONAL,
325 IN UINT16 BootOptionNumber,
326 IN UINT32 Modifier,
327 ...
328 );
329
341EFIAPI
343 IN EFI_BOOT_MANAGER_KEY_OPTION *DeletedOption OPTIONAL,
344 IN UINT32 Modifier,
345 ...
346 );
347
360EFIAPI
362 IN UINT32 Modifier,
363 ...
364 );
365
369VOID
370EFIAPI
372 VOID
373 );
374
375//
376// Boot Manager boot library functions.
377//
378
394VOID
395EFIAPI
397 VOID
398 );
399
418VOID
419EFIAPI
422 );
423
437EFIAPI
440 );
441
457EFIAPI
461 );
462
475VOID *
476EFIAPI
479 OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,
480 OUT UINTN *FileSize
481 );
482
487typedef
488VOID
490 VOID
491 );
492
496typedef
497VOID
500 );
501
508VOID
509EFIAPI
511 EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION RefreshLegacyBootOption,
513 );
514
524typedef
525CHAR16 *
527 IN EFI_HANDLE Handle,
528 IN CONST CHAR16 *DefaultDescription
529 );
530
541EFIAPI
544 );
545
546//
547// Boot Manager connect and disconnect library functions
548//
549
556VOID
557EFIAPI
559 VOID
560 );
561
581EFIAPI
583 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect,
584 OUT EFI_HANDLE *MatchingHandle OPTIONAL
585 );
586
594VOID
595EFIAPI
597 VOID
598 );
599
600//
601// Boot Manager console library functions
602//
603
604typedef enum {
605 ConIn,
606 ConOut,
607 ErrOut,
608 ConInDev,
609 ConOutDev,
610 ErrOutDev,
611 ConsoleTypeMax
612} CONSOLE_TYPE;
613
623EFIAPI
625 VOID
626 );
627
644EFIAPI
646 IN CONSOLE_TYPE ConsoleType,
647 IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath,
648 IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath
649 );
650
666EFIAPI
668 IN CONSOLE_TYPE ConsoleType
669 );
670
680EFIAPI
682 IN EFI_HANDLE VideoController
683 );
684
694EFIAPI
696 EFI_HANDLE VideoController OPTIONAL
697 );
698
699//
700// Boot Manager driver health library functions.
701//
702
703typedef struct {
704 EFI_DRIVER_HEALTH_PROTOCOL *DriverHealth;
705
710 EFI_HANDLE ControllerHandle;
711 EFI_HANDLE ChildHandle;
712
717
722
728
746EFIAPI
748 UINTN *Count
749 );
750
761EFIAPI
763 EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *DriverHealthInfo,
764 UINTN Count
765 );
766
778EFIAPI
781 );
782
795BOOLEAN
796EFIAPI
798 IN CHAR16 *VariableName,
799 OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType OPTIONAL,
800 OUT UINT16 *OptionNumber OPTIONAL
801 );
802
811EFIAPI
813 VOID
814 );
815
816#endif
UINT64 UINTN
INT64 INTN
EFI_DRIVER_HEALTH_STATUS
Definition: DriverHealth.h:45
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
VOID EFIAPI EfiBootManagerSortLoadOptionVariable(IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType, IN SORT_COMPARE CompareFunction)
EFI_STATUS EFIAPI EfiBootManagerDispatchDeferredImages(VOID)
Definition: BmMisc.c:428
EFI_STATUS EFIAPI EfiBootManagerConnectConsoleVariable(IN CONSOLE_TYPE ConsoleType)
Definition: BmConsole.c:521
EFI_STATUS EFIAPI EfiBootManagerLoadOptionToVariable(IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
Definition: BmLoadOption.c:170
VOID EFIAPI EfiBootManagerBoot(IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
Definition: BmBoot.c:1846
EFI_STATUS EFIAPI EfiBootManagerStartHotkeyService(IN EFI_EVENT *HotkeyTriggered)
Definition: BmHotkey.c:882
VOID *EFIAPI EfiBootManagerGetLoadOptionBuffer(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT UINTN *FileSize)
Definition: BmBoot.c:1607
CHAR16 *(EFIAPI * EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER)(IN EFI_HANDLE Handle, IN CONST CHAR16 *DefaultDescription)
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOption(IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
EFI_STATUS EFIAPI EfiBootManagerConnectVideoController(EFI_HANDLE VideoController OPTIONAL)
Definition: BmConsole.c:232
VOID EFIAPI EfiBootManagerHotkeyBoot(VOID)
Definition: BmHotkey.c:328
EFI_STATUS EFIAPI EfiBootManagerConnectAllDefaultConsoles(VOID)
Definition: BmConsole.c:712
EFI_STATUS EFIAPI EfiBootManagerRegisterContinueKeyOption(IN UINT32 Modifier,...)
Definition: BmHotkey.c:813
EFI_DEVICE_PATH_PROTOCOL *EFIAPI EfiBootManagerGetNextLoadOptionDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
Definition: BmBoot.c:2664
EFI_STATUS EFIAPI EfiBootManagerUpdateConsoleVariable(IN CONSOLE_TYPE ConsoleType, IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath)
Definition: BmConsole.c:418
EFI_BOOT_MANAGER_LOAD_OPTION *EFIAPI EfiBootManagerGetLoadOptions(OUT UINTN *LoadOptionCount, IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType)
VOID EFIAPI EfiBootManagerRefreshAllBootOption(VOID)
Definition: BmBoot.c:2388
VOID(EFIAPI * EFI_BOOT_MANAGER_LEGACY_BOOT)(IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
EFI_STATUS EFIAPI EfiBootManagerAddLoadOptionVariable(IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option, IN UINTN Position)
Definition: BmLoadOption.c:367
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOptions(IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOptions, IN UINTN LoadOptionCount)
EFI_STATUS EFIAPI EfiBootManagerVariableToLoadOption(IN CHAR16 *VariableName, IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
Definition: BmLoadOption.c:998
VOID(EFIAPI * EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION)(VOID)
EFI_STATUS EFIAPI EfiBootManagerConnectDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect, OUT EFI_HANDLE *MatchingHandle OPTIONAL)
Definition: BmConnect.c:108
EFI_STATUS EFIAPI EfiBootManagerFreeDriverHealthInfo(EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *DriverHealthInfo, UINTN Count)
VOID EFIAPI EfiBootManagerRegisterLegacyBootSupport(EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION RefreshLegacyBootOption, EFI_BOOT_MANAGER_LEGACY_BOOT LegacyBoot)
Definition: BmBoot.c:60
INTN EFIAPI EfiBootManagerFindLoadOption(IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key, IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array, IN UINTN Count)
Definition: BmLoadOption.c:548
EFI_STATUS EFIAPI EfiBootManagerDeleteLoadOptionVariable(IN UINTN OptionNumber, IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType)
Definition: BmLoadOption.c:584
VOID EFIAPI EfiBootManagerConnectAll(VOID)
Definition: BmConnect.c:67
BOOLEAN EFIAPI EfiBootManagerIsValidLoadOptionVariableName(IN CHAR16 *VariableName, OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType OPTIONAL, OUT UINT16 *OptionNumber OPTIONAL)
Definition: BmLoadOption.c:808
EFI_STATUS EFIAPI EfiBootManagerGetBootManagerMenu(EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
Definition: BmBoot.c:2608
EFI_STATUS EFIAPI EfiBootManagerDeleteKeyOptionVariable(IN EFI_BOOT_MANAGER_KEY_OPTION *DeletedOption OPTIONAL, IN UINT32 Modifier,...)
Definition: BmHotkey.c:1089
EFI_STATUS EFIAPI EfiBootManagerRegisterBootDescriptionHandler(IN EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER Handler)
EFI_STATUS EFIAPI EfiBootManagerInitializeLoadOption(IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option, IN UINTN OptionNumber, IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType, IN UINT32 Attributes, IN CHAR16 *Description, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN UINT8 *OptionalData, IN UINT32 OptionalDataSize)
VOID EFIAPI EfiBootManagerDisconnectAll(VOID)
Definition: BmConnect.c:202
EFI_DEVICE_PATH_PROTOCOL *EFIAPI EfiBootManagerGetGopDevicePath(IN EFI_HANDLE VideoController)
Definition: BmConsole.c:117
EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *EFIAPI EfiBootManagerGetDriverHealthInfo(UINTN *Count)
EFI_STATUS EFIAPI EfiBootManagerProcessLoadOption(EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
EFI_STATUS EFIAPI EfiBootManagerAddKeyOptionVariable(OUT EFI_BOOT_MANAGER_KEY_OPTION *AddedOption OPTIONAL, IN UINT16 BootOptionNumber, IN UINT32 Modifier,...)
Definition: BmHotkey.c:972
VOID * EFI_HII_HANDLE
EFI_DRIVER_HEALTH_STATUS HealthStatus
EFI_DRIVER_HEALTH_HII_MESSAGE * MessageList
Definition: Base.h:213