#include <Uefi.h>
#include <Library/OcMainLib.h>
#include "BootManagementInternal.h"
#include <Guid/AppleFile.h>
#include <Guid/AppleVariable.h>
#include <Guid/GlobalVariable.h>
#include <Guid/Gpt.h>
#include <Guid/OcVariable.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/OcFirmwareRuntime.h>
#include <Protocol/SimpleFileSystem.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcVariableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
Go to the source code of this file.
Functions | |
CONST OC_CUSTOM_BOOT_DEVICE_PATH * | InternalGetOcCustomDevPath (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
CONST OC_ENTRY_PROTOCOL_DEVICE_PATH * | InternalGetOcEntryProtocolDevPath (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
EFI_DEVICE_PATH_PROTOCOL * | InternalGetBootOptionPath (IN EFI_LOAD_OPTION *LoadOption, IN UINTN LoadOptionSize) |
VOID | InternalDebugBootEnvironment (IN CONST UINT16 *BootOrder, IN EFI_GUID *BootGuid, IN UINTN BootOrderCount) |
STATIC BOOLEAN | InternalMatchBootEntryByDevicePath (IN OUT OC_BOOT_ENTRY *BootEntry, IN EFI_DEVICE_PATH_PROTOCOL *UefiDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *UefiRemainingDevicePath, IN UINTN UefiDevicePathSize, IN BOOLEAN IsBootNext) |
STATIC BOOLEAN | InternalMatchCustomBootEntryByDevicePath (IN OUT OC_BOOT_ENTRY *BootEntry, IN CONST OC_CUSTOM_BOOT_DEVICE_PATH *DevicePath) |
STATIC BOOLEAN | InternalMatchEntryProtocolEntryByDevicePath (IN OUT OC_BOOT_ENTRY *BootEntry, IN CONST OC_ENTRY_PROTOCOL_DEVICE_PATH *DevicePath) |
STATIC VOID | InternalClearNextVariables (IN EFI_GUID *BootVariableGuid, IN BOOLEAN ClearApplePayload) |
STATIC BOOLEAN | InternalHasFirmwareUpdateAsNext (IN EFI_GUID *BootVariableGuid) |
BOOLEAN | InternalIsAppleLegacyLoadApp (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
UINT16 * | OcGetBootOrder (IN EFI_GUID *BootVariableGuid, IN BOOLEAN WithBootNext, OUT UINTN *BootOrderCount, OUT BOOLEAN *Deduplicated OPTIONAL, OUT BOOLEAN *HasBootNext OPTIONAL, IN BOOLEAN UseBootNextOnly) |
UINT16 * | InternalGetBootOrderForBooting (IN EFI_GUID *BootVariableGuid, IN BOOLEAN BlacklistAppleUpdate, OUT UINTN *BootOrderCount, IN BOOLEAN UseBootNextOnly) |
EFI_STATUS | OcSetDefaultBootEntry (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *Entry) |
EFI_LOAD_OPTION * | InternalGetBoostrapOptionData (OUT UINTN *LoadOptionSize, OUT UINT16 *BootOption, OUT EFI_DEVICE_PATH_PROTOCOL **LoadPath, IN UINT16 *BootOptions, IN UINTN NumBootOptions, IN CONST CHAR16 *MatchSuffix, IN UINTN MatchSuffixLen) |
STATIC EFI_STATUS | InternalRegisterBootstrapBootOption (IN CONST CHAR16 *OptionName, IN EFI_HANDLE DeviceHandle, IN CONST CHAR16 *FilePath, IN BOOLEAN ShortForm, IN CONST CHAR16 *MatchSuffix, IN UINTN MatchSuffixLen) |
EFI_STATUS | OcRegisterBootstrapBootOption (IN CONST CHAR16 *OptionName, IN EFI_HANDLE DeviceHandle, IN CONST CHAR16 *FilePath, IN BOOLEAN ShortForm, IN CONST CHAR16 *MatchSuffix, IN UINTN MatchSuffixLen) |
EFI_STATUS | InternalLoadBootEntry (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN EFI_HANDLE ParentHandle, OUT EFI_HANDLE *EntryHandle, OUT INTERNAL_DMG_LOAD_CONTEXT *DmgLoadContext, OUT VOID **CustomFreeContext) |
Variables | |
STATIC CONST OC_CUSTOM_BOOT_DEVICE_PATH_DECL | mOcCustomBootDevPathTemplate |
STATIC CONST OC_ENTRY_PROTOCOL_DEVICE_PATH_DECL | mOcEntryProtocolDevPathTemplate |
Copyright (C) 2019-2021, vit9696, mikebeaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file DefaultEntryChoice.c.
STATIC VOID InternalClearNextVariables | ( | IN EFI_GUID * | BootVariableGuid, |
IN BOOLEAN | ClearApplePayload ) |
Definition at line 409 of file DefaultEntryChoice.c.
VOID InternalDebugBootEnvironment | ( | IN CONST UINT16 * | BootOrder, |
IN EFI_GUID * | BootGuid, | ||
IN UINTN | BootOrderCount ) |
Definition at line 186 of file DefaultEntryChoice.c.
EFI_LOAD_OPTION * InternalGetBoostrapOptionData | ( | OUT UINTN * | LoadOptionSize, |
OUT UINT16 * | BootOption, | ||
OUT EFI_DEVICE_PATH_PROTOCOL ** | LoadPath, | ||
IN UINT16 * | BootOptions, | ||
IN UINTN | NumBootOptions, | ||
IN CONST CHAR16 * | MatchSuffix, | ||
IN UINTN | MatchSuffixLen ) |
Definition at line 1188 of file DefaultEntryChoice.c.
EFI_DEVICE_PATH_PROTOCOL * InternalGetBootOptionPath | ( | IN EFI_LOAD_OPTION * | LoadOption, |
IN UINTN | LoadOptionSize ) |
Definition at line 141 of file DefaultEntryChoice.c.
UINT16 * InternalGetBootOrderForBooting | ( | IN EFI_GUID * | BootVariableGuid, |
IN BOOLEAN | BlacklistAppleUpdate, | ||
OUT UINTN * | BootOrderCount, | ||
IN BOOLEAN | UseBootNextOnly ) |
Definition at line 721 of file DefaultEntryChoice.c.
CONST OC_CUSTOM_BOOT_DEVICE_PATH * InternalGetOcCustomDevPath | ( | IN CONST EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Determines whether DevicePath is an OpenCore custom boot entry.
Definition at line 75 of file DefaultEntryChoice.c.
CONST OC_ENTRY_PROTOCOL_DEVICE_PATH * InternalGetOcEntryProtocolDevPath | ( | IN CONST EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Determines whether DevicePath is a Boot Entry Protocol custom boot entry.
Definition at line 108 of file DefaultEntryChoice.c.
STATIC BOOLEAN InternalHasFirmwareUpdateAsNext | ( | IN EFI_GUID * | BootVariableGuid | ) |
Definition at line 497 of file DefaultEntryChoice.c.
BOOLEAN InternalIsAppleLegacyLoadApp | ( | IN CONST EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Definition at line 552 of file DefaultEntryChoice.c.
EFI_STATUS InternalLoadBootEntry | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_BOOT_ENTRY * | BootEntry, | ||
IN EFI_HANDLE | ParentHandle, | ||
OUT EFI_HANDLE * | EntryHandle, | ||
OUT INTERNAL_DMG_LOAD_CONTEXT * | DmgLoadContext, | ||
OUT VOID ** | CustomFreeContext ) |
Definition at line 1527 of file DefaultEntryChoice.c.
STATIC BOOLEAN InternalMatchBootEntryByDevicePath | ( | IN OUT OC_BOOT_ENTRY * | BootEntry, |
IN EFI_DEVICE_PATH_PROTOCOL * | UefiDevicePath, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | UefiRemainingDevicePath, | ||
IN UINTN | UefiDevicePathSize, | ||
IN BOOLEAN | IsBootNext ) |
Definition at line 287 of file DefaultEntryChoice.c.
STATIC BOOLEAN InternalMatchCustomBootEntryByDevicePath | ( | IN OUT OC_BOOT_ENTRY * | BootEntry, |
IN CONST OC_CUSTOM_BOOT_DEVICE_PATH * | DevicePath ) |
Definition at line 362 of file DefaultEntryChoice.c.
STATIC BOOLEAN InternalMatchEntryProtocolEntryByDevicePath | ( | IN OUT OC_BOOT_ENTRY * | BootEntry, |
IN CONST OC_ENTRY_PROTOCOL_DEVICE_PATH * | DevicePath ) |
Definition at line 383 of file DefaultEntryChoice.c.
STATIC EFI_STATUS InternalRegisterBootstrapBootOption | ( | IN CONST CHAR16 * | OptionName, |
IN EFI_HANDLE | DeviceHandle, | ||
IN CONST CHAR16 * | FilePath, | ||
IN BOOLEAN | ShortForm, | ||
IN CONST CHAR16 * | MatchSuffix, | ||
IN UINTN | MatchSuffixLen ) |
Definition at line 1248 of file DefaultEntryChoice.c.
UINT16 * OcGetBootOrder | ( | IN EFI_GUID * | BootVariableGuid, |
IN BOOLEAN | WithBootNext, | ||
OUT UINTN * | BootOrderCount, | ||
OUT BOOLEAN *Deduplicated | OPTIONAL, | ||
OUT BOOLEAN *HasBootNext | OPTIONAL, | ||
IN BOOLEAN | UseBootNextOnly ) |
Obtain BootOrder entry list.
[in] | BootVariableGuid | GUID namespace for boot entries. |
[in] | WithBootNext | Add BootNext as the first option if available. |
[out] | BootOrderCount | Number of entries in boot order. |
[out] | Deduplicated | Whether the list was changed during deduplication, optional. |
[out] | HasBootNext | Whether the list starts with BootNext, optional |
[in] | UseBootNextOnly | Return list containing BootNext entry only |
boot | order entry list allocated from pool or NULL. |
Definition at line 578 of file DefaultEntryChoice.c.
EFI_STATUS OcRegisterBootstrapBootOption | ( | IN CONST CHAR16 * | OptionName, |
IN EFI_HANDLE | DeviceHandle, | ||
IN CONST CHAR16 * | FilePath, | ||
IN BOOLEAN | ShortForm, | ||
IN CONST CHAR16 * | MatchSuffix, | ||
IN UINTN | MatchSuffixLen ) |
Register top-most priority boot option. MatchSuffix allows for fuzzy replacement of the option, i.e. when a new option replaces an old one with a matching suffix but a different prefix.
[in] | OptionName | Option name to create. |
[in] | DeviceHandle | Device handle of the file system. |
[in] | FilePath | Bootloader path. |
[in] | ShortForm | Whether the Device Path should be written in short-form. |
[in] | MatchSuffix | The file Device Path suffix of a matching option. |
[in] | MatchSuffixLen | The length, in characters, of MatchSuffix. |
EFI_SUCCESS | on success. |
Definition at line 1498 of file DefaultEntryChoice.c.
EFI_STATUS OcSetDefaultBootEntry | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_BOOT_ENTRY * | Entry ) |
Set default entry to passed entry.
[in] | Context | Picker context. |
[in,out] | Entry | Entry to make default. |
EFI_SUCCESS | on success. |
Definition at line 772 of file DefaultEntryChoice.c.
STATIC CONST OC_CUSTOM_BOOT_DEVICE_PATH_DECL mOcCustomBootDevPathTemplate |
Template for OpenCore custom boot entry DevicePath.
Definition at line 38 of file DefaultEntryChoice.c.
STATIC CONST OC_ENTRY_PROTOCOL_DEVICE_PATH_DECL mOcEntryProtocolDevPathTemplate |
Template for Boot Entry Protocol custom boot entry DevicePath.
Definition at line 57 of file DefaultEntryChoice.c.