TianoCore EDK2 master
Loading...
Searching...
No Matches
InternalBm.h
Go to the documentation of this file.
1
11#ifndef _INTERNAL_BM_H_
12#define _INTERNAL_BM_H_
13
14#include <PiDxe.h>
15
21#include <IndustryStandard/Sd.h>
23
25#include <Protocol/BlockIo.h>
28#include <Protocol/LoadFile.h>
29#include <Protocol/DevicePath.h>
35#include <Protocol/PciIo.h>
37#include <Protocol/UsbIo.h>
38#include <Protocol/DiskInfo.h>
41#include <Protocol/BootLogo.h>
44#include <Protocol/RamDisk.h>
46#include <Protocol/PlatformBootManager.h>
47
49#include <Guid/FileInfo.h>
50#include <Guid/GlobalVariable.h>
53
54#include <Library/PrintLib.h>
55#include <Library/DebugLib.h>
59#include <Library/UefiLib.h>
62#include <Library/HobLib.h>
63#include <Library/BaseLib.h>
66#include <Library/PcdLib.h>
71#include <Library/CapsuleLib.h>
73#include <Library/HiiLib.h>
74
75#if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)
76 #if defined (MDE_CPU_EBC)
77//
78// Uefi specification only defines the default boot file name for IA32, X64
79// and IPF processor, so need define boot file name for EBC architecture here.
80//
81#define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTEBC.EFI"
82 #else
83 #error "Can not determine the default boot file name for unknown processor type!"
84 #endif
85#endif
86
87typedef enum {
88 BmAcpiFloppyBoot,
89 BmHardwareDeviceBoot,
90 BmMessageAtapiBoot,
91 BmMessageSataBoot,
92 BmMessageUsbBoot,
93 BmMessageScsiBoot,
94 BmMiscBoot
95} BM_BOOT_TYPE;
96
97typedef
98CHAR16 *
99(*BM_GET_BOOT_DESCRIPTION) (
100 IN EFI_HANDLE Handle
101 );
102
103//
104// PlatformRecovery#### is the load option with the longest name
105//
106#define BM_OPTION_NAME_LEN sizeof ("PlatformRecovery####")
107extern CHAR16 *mBmLoadOptionName[];
108
109//
110// Maximum number of reconnect retry to repair controller; it is to limit the
111// number of recursive call of BmRepairAllControllers.
112//
113#define MAX_RECONNECT_REPAIR 10
114
123typedef
124VOID
126 CHAR16 *Name,
127 EFI_GUID *Guid,
128 VOID *Context
129 );
130
137VOID
139 BM_VARIABLE_VISITOR Visitor,
140 VOID *Context
141 );
142
143#define BM_BOOT_DESCRIPTION_ENTRY_SIGNATURE SIGNATURE_32 ('b', 'm', 'd', 'h')
144typedef struct {
145 UINT32 Signature;
146 LIST_ENTRY Link;
149
156VOID
158 UINTN ReconnectRepairCount
159 );
160
161#define BM_HOTKEY_SIGNATURE SIGNATURE_32 ('b', 'm', 'h', 'k')
162typedef struct {
163 UINT32 Signature;
164 LIST_ENTRY Link;
165
166 BOOLEAN IsContinue;
167 UINT16 BootOption;
168 UINT8 CodeCount;
169 UINT8 WaitingKey;
170 EFI_KEY_DATA KeyData[3];
171} BM_HOTKEY;
172
173#define BM_HOTKEY_FROM_LINK(a) CR (a, BM_HOTKEY, Link, BM_HOTKEY_SIGNATURE)
174
188 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType,
189 OUT UINT16 *FreeOptionNumber
190 );
191
202VOID
204 IN BOOLEAN Boot
205 );
206
219BOOLEAN
221 IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath,
222 IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath
223 );
224
241 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
242 );
243
250VOID
251EFIAPI
253 IN EFI_EVENT Event,
254 IN VOID *Context
255 );
256
292 IN CHAR16 *VariableName,
293 IN EFI_GUID *VendorGuid,
294 IN UINT32 Attributes,
295 IN UINTN DataSize,
296 IN VOID *Data
297 );
298
312BOOLEAN
316 );
317
335 );
336
342VOID
343BmPrintDp (
344 EFI_DEVICE_PATH_PROTOCOL *DevicePath
345 );
346
355UINTN
357 IN CHAR16 Char
358 );
359
367CHAR16 *
369 IN EFI_HANDLE Handle
370 );
371
379VOID
381 EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions,
382 UINTN BootOptionCount
383 );
384
395 IN EFI_HANDLE LoadFileHandle,
397 );
398
409 );
410
420VOID
422 IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath
423 );
424
440 );
441
462VOID *
464 IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type,
466 OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,
467 OUT UINTN *FileSize
468 );
469
470#endif // _INTERNAL_BM_H_
UINT64 UINTN
VOID BmForEachVariable(BM_VARIABLE_VISITOR Visitor, VOID *Context)
Definition: BmLoadOption.c:37
VOID BmSetMemoryTypeInformationVariable(IN BOOLEAN Boot)
Definition: BmMisc.c:129
VOID BmMakeBootOptionDescriptionUnique(EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions, UINTN BootOptionCount)
VOID BmPrintDp(EFI_DEVICE_PATH_PROTOCOL *DevicePath)
Definition: BmMisc.c:382
EFI_STATUS BmConnectUsbShortFormDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
Definition: BmConnect.c:245
VOID * BmGetNextLoadOptionBuffer(IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT UINTN *FileSize)
UINTN BmCharToUint(IN CHAR16 Char)
Definition: BmMisc.c:404
EFI_STATUS BmSetVariableAndReportStatusCodeOnError(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
Definition: BmMisc.c:328
EFI_DEVICE_PATH_PROTOCOL * BmDelPartMatchInstance(IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single)
Definition: BmMisc.c:26
EFI_DEVICE_PATH_PROTOCOL * BmGetNextLoadOptionDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
Definition: BmBoot.c:1634
CHAR16 * BmGetBootDescription(IN EFI_HANDLE Handle)
VOID BmRepairAllControllers(UINTN ReconnectRepairCount)
EFI_DEVICE_PATH_PROTOCOL * BmGetRamDiskDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
Definition: BmBoot.c:1308
VOID BmDestroyRamDisk(IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath)
Definition: BmBoot.c:1385
BOOLEAN BmMatchDevicePaths(IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single)
Definition: BmMisc.c:82
BOOLEAN BmMatchPartitionDevicePathNode(IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath, IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath)
Definition: BmBoot.c:2134
EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFile(IN EFI_HANDLE LoadFileHandle, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
Definition: BmBoot.c:1419
VOID(* BM_VARIABLE_VISITOR)(CHAR16 *Name, EFI_GUID *Guid, VOID *Context)
Definition: InternalBm.h:125
VOID EFIAPI BmStopHotkeyService(IN EFI_EVENT Event, IN VOID *Context)
Definition: BmHotkey.c:850
EFI_STATUS BmGetFreeOptionNumber(IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType, OUT UINT16 *FreeOptionNumber)
Definition: BmLoadOption.c:85
#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
CHAR16 *(EFIAPI * EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER)(IN EFI_HANDLE Handle, IN CONST CHAR16 *DefaultDescription)
Definition: Base.h:213