OpenCore
1.0.4
OpenCore Bootloader
|
#include <PiDxe.h>
#include <Guid/AppleVariable.h>
#include <IndustryStandard/AppleBootArgs.h>
#include <IndustryStandard/AppleHid.h>
#include <Library/OcAppleBootPolicyLib.h>
#include <Library/OcAppleDiskImageLib.h>
#include <Library/OcAppleKeyMapLib.h>
#include <Library/OcFlexArrayLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcStorageLib.h>
#include <Library/OcTypingLib.h>
#include <Protocol/AppleKeyMapAggregator.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/AppleBeepGen.h>
#include <Protocol/OcAudio.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/AppleUserInterface.h>
Go to the source code of this file.
Data Structures | |
struct | OC_BOOT_ENTRY_ |
struct | OC_PARSED_VAR_ASCII_ |
struct | OC_PARSED_VAR_UNICODE_ |
union | OC_PARSED_VAR_ |
struct | OC_BOOT_FILESYSTEM_ |
struct | OC_BOOT_CONTEXT_ |
struct | OC_PICKER_ENTRY |
struct | OC_PICKER_KEY_INFO |
struct | OC_KB_DEBUG_CALLBACKS |
struct | OC_PRIVILEGE_CONTEXT |
struct | OC_PICKER_CONTEXT_ |
struct | OC_HOTKEY_CONTEXT_ |
struct | OC_BOOT_ARGUMENTS_ |
Typedefs | |
typedef struct OC_PICKER_CONTEXT_ | OC_PICKER_CONTEXT |
typedef struct OC_HOTKEY_CONTEXT_ | OC_HOTKEY_CONTEXT |
typedef UINT32 | OC_BOOT_ENTRY_TYPE |
typedef enum OC_PICKER_MODE_ | OC_PICKER_MODE |
typedef EFI_STATUS(* | OC_BOOT_SYSTEM_ACTION) (IN OUT OC_PICKER_CONTEXT *PickerContext) |
typedef EFI_STATUS(* | OC_BOOT_UNMANAGED_ACTION) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
typedef EFI_STATUS(* | OC_BOOT_UNMANAGED_GET_FINAL_DP) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath) |
typedef struct OC_BOOT_ENTRY_ | OC_BOOT_ENTRY |
typedef EFI_STATUS(EFIAPI * | OC_CUSTOM_READ) (IN OC_STORAGE_CONTEXT *Storage, IN OC_BOOT_ENTRY *ChosenEntry, OUT VOID **Data, OUT UINT32 *DataSize, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *StorageHandle, OUT EFI_DEVICE_PATH_PROTOCOL **StoragePath, IN OC_DMG_LOADING_SUPPORT DmgLoading, OUT OC_APPLE_DISK_IMAGE_PRELOAD_CONTEXT *DmgPreloadContext, OUT VOID **CustomFreeContext) |
typedef EFI_STATUS(EFIAPI * | OC_CUSTOM_FREE) (IN VOID *CustomFreeContext) |
typedef struct OC_PARSED_VAR_ASCII_ | OC_PARSED_VAR_ASCII |
typedef struct OC_PARSED_VAR_UNICODE_ | OC_PARSED_VAR_UNICODE |
typedef union OC_PARSED_VAR_ | OC_PARSED_VAR |
typedef struct OC_BOOT_FILESYSTEM_ | OC_BOOT_FILESYSTEM |
typedef struct OC_BOOT_CONTEXT_ | OC_BOOT_CONTEXT |
typedef EFI_STATUS(EFIAPI * | OC_IMAGE_START) (IN OC_BOOT_ENTRY *ChosenEntry, IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData OPTIONAL, IN BOOLEAN LaunchInText) |
typedef INTN | OC_KEY_CODE |
typedef UINT16 | OC_MODIFIER_MAP |
typedef UINTN | OC_PICKER_KEY_MAP |
typedef EFI_STATUS(EFIAPI * | OC_REQ_PRIVILEGE) (IN OC_PICKER_CONTEXT *Context, IN OC_PRIVILEGE_LEVEL Level) |
typedef EFI_STATUS(EFIAPI * | OC_SHOW_MENU) (IN OC_BOOT_CONTEXT *BootContext, IN OC_BOOT_ENTRY **BootEntries, OUT OC_BOOT_ENTRY **ChosenBootEntry) |
typedef EFI_STATUS(EFIAPI * | OC_GET_ENTRY_LABEL_IMAGE) (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN UINT8 Scale, OUT VOID **ImageData, OUT UINT32 *DataLength) |
typedef EFI_STATUS(EFIAPI * | OC_GET_ENTRY_ICON) (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, OUT VOID **ImageData, OUT UINT32 *DataLength) |
typedef VOID(EFIAPI * | OC_GET_KEY_INFO) (IN OUT OC_PICKER_CONTEXT *Context, IN OC_PICKER_KEY_MAP KeyFilter, OUT OC_PICKER_KEY_INFO *PickerKeyInfo) |
typedef UINT64(EFIAPI * | OC_GET_KEY_WAIT_END_TIME) (IN UINT64 Timeout) |
typedef BOOLEAN(EFIAPI * | OC_WAIT_FOR_KEY_INFO) (IN OUT OC_PICKER_CONTEXT *Context, IN UINT64 EndTime, IN OC_PICKER_KEY_MAP KeyFilter, IN OUT OC_PICKER_KEY_INFO *PickerKeyInfo) |
typedef VOID(EFIAPI * | OC_FLUSH_TYPING_BUFFER) (IN OUT OC_PICKER_CONTEXT *Context) |
typedef EFI_STATUS(EFIAPI * | OC_PLAY_AUDIO_FILE) (IN OC_PICKER_CONTEXT *Context, IN CONST CHAR8 *BasePath, IN CONST CHAR8 *BaseType, IN BOOLEAN Fallback) |
typedef EFI_STATUS(EFIAPI * | OC_PLAY_AUDIO_BEEP) (IN OC_PICKER_CONTEXT *Context, IN UINT32 ToneCount, IN UINT32 ToneLength, IN UINT32 SilenceLength) |
typedef EFI_STATUS(EFIAPI * | OC_PLAY_AUDIO_ENTRY) (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *Entry) |
typedef VOID(EFIAPI * | OC_TOGGLE_VOICE_OVER) (IN OC_PICKER_CONTEXT *Context, IN CONST CHAR8 *BasePath OPTIONAL, IN CONST CHAR8 *BaseType OPTIONAL) |
typedef VOID(EFIAPI * | OC_KB_DEBUG_INSTRUMENT_LOOP_DELAY) (UINT64 LoopDelayStart, UINT64 LoopDelayEnd) |
typedef VOID(EFIAPI * | OC_KB_DEBUG_SHOW) (UINTN NumKeysDown, UINTN NumKeysHeld, APPLE_MODIFIER_MAP Modifiers) |
typedef BOOLEAN(EFIAPI * | OC_VERIFY_PASSWORD) (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST OC_PRIVILEGE_CONTEXT *PrivilegeContext) |
typedef struct OC_BOOT_ARGUMENTS_ | OC_BOOT_ARGUMENTS |
typedef VOID(* | OC_IMAGE_LOADER_PATCH) (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN VOID *SourceBuffer, IN UINTN SourceSize) |
typedef VOID(* | OC_IMAGE_LOADER_CONFIGURE) (IN OUT EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, IN UINT32 Capabilities) |
Enumerations | |
enum | OC_PICKER_MODE_ { OcPickerModeBuiltin , OcPickerModeExternal , OcPickerModeApple } |
enum | OC_DMG_LOADING_SUPPORT { OcDmgLoadingDisabled , OcDmgLoadingAnyImage , OcDmgLoadingAppleSigned } |
enum | OC_PRIVILEGE_LEVEL { OcPrivilegeUnauthorized = 0 , OcPrivilegeAuthorized = 1 } |
enum | OC_PICKER_CMD { OcPickerDefault = 0 , OcPickerShowPicker = 1 , OcPickerProtocolHotKey = 2 , OcPickerBootApple = 3 , OcPickerBootAppleRecovery = 4 } |
Functions | |
EFI_STATUS EFIAPI | OcGetBootEntryLabelImage (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN UINT8 Scale, OUT VOID **ImageData, OUT UINT32 *DataLength) |
EFI_STATUS EFIAPI | OcGetBootEntryIcon (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, OUT VOID **ImageData, OUT UINT32 *DataLength) |
OC_BOOT_CONTEXT * | OcScanForBootEntries (IN OC_PICKER_CONTEXT *Context) |
OC_BOOT_CONTEXT * | OcScanForDefaultBootEntry (IN OC_PICKER_CONTEXT *Context, IN BOOLEAN UseBootNextOnly) |
OC_BOOT_ENTRY ** | OcEnumerateEntries (IN OC_BOOT_CONTEXT *BootContext) |
VOID | OcFreeBootContext (IN OUT OC_BOOT_CONTEXT *Context) |
UINT32 | OcGetDefaultBootEntry (IN OC_PICKER_CONTEXT *Context, IN OUT OC_BOOT_ENTRY *BootEntries, IN UINTN NumBootEntries) |
EFI_STATUS | OcSetDefaultBootEntry (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *Entry) |
EFI_STATUS EFIAPI | OcShowSimplePasswordRequest (IN OC_PICKER_CONTEXT *Context, IN OC_PRIVILEGE_LEVEL Level) |
BOOLEAN EFIAPI | OcVerifyPassword (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST OC_PRIVILEGE_CONTEXT *PrivilegeContext) |
EFI_STATUS EFIAPI | OcShowSimpleBootMenu (IN OC_BOOT_CONTEXT *BootContext, IN OC_BOOT_ENTRY **BootEntries, OUT OC_BOOT_ENTRY **ChosenBootEntry) |
EFI_STATUS | OcLoadBootEntry (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN EFI_HANDLE ParentHandle) |
EFI_STATUS | OcActivateHibernateWake (IN UINT32 HibernateMask) |
EFI_STATUS | OcHandleRecoveryRequest (OUT EFI_DEVICE_PATH_PROTOCOL **Initiator OPTIONAL) |
VOID * | OcReadApplePanicLog (OUT UINT32 *PanicSize) |
BOOLEAN | OcIsAppleHibernateWake (VOID) |
VOID | OcLoadPickerHotKeys (IN OUT OC_PICKER_CONTEXT *Context) |
EFI_STATUS | OcInitHotKeys (IN OUT OC_PICKER_CONTEXT *Context) |
VOID | OcFreeHotKeys (IN OC_PICKER_CONTEXT *Context) |
EFI_STATUS | OcRunBootPicker (IN OC_PICKER_CONTEXT *Context) |
UINT32 | OcGetDevicePolicyType (IN EFI_HANDLE Handle, OUT BOOLEAN *External OPTIONAL) |
UINT32 | OcGetFileSystemPolicyType (IN EFI_HANDLE Handle) |
OC_BOOT_ENTRY_TYPE | OcGetBootDevicePathType (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT BOOLEAN *IsFolder OPTIONAL, OUT BOOLEAN *IsGeneric OPTIONAL) |
EFI_LOADED_IMAGE_PROTOCOL * | OcGetAppleBootLoadedImage (IN EFI_HANDLE ImageHandle) |
BOOLEAN EFIAPI | OcValidLoadOptions (IN UINT32 LoadOptionsSize, IN CONST VOID *LoadOptions) |
BOOLEAN EFIAPI | OcHasLoadOptions (IN UINT32 LoadOptionsSize, IN CONST VOID *LoadOptions) |
VOID | OcParseBootArgs (OUT OC_BOOT_ARGUMENTS *Arguments, IN VOID *BootArgs) |
BOOLEAN | OcCheckArgumentFromEnv (IN EFI_LOADED_IMAGE *LoadedImage OPTIONAL, IN EFI_GET_VARIABLE GetVariable OPTIONAL, IN CONST CHAR8 *Argument, IN CONST UINTN ArgumentLength, IN OUT CHAR8 **Value OPTIONAL) |
CONST CHAR8 * | OcGetArgumentFromCmd (IN CONST CHAR8 *CommandLine, IN CONST CHAR8 *Argument, IN CONST UINTN ArgumentLength, OUT UINTN *ValueLength OPTIONAL) |
VOID | OcRemoveArgumentFromCmd (IN OUT CHAR8 *CommandLine, IN CONST CHAR8 *Argument) |
BOOLEAN | OcAppendArgumentToCmd (IN OUT OC_PICKER_CONTEXT *Context OPTIONAL, IN OUT CHAR8 *CommandLine, IN CONST CHAR8 *Argument, IN CONST UINTN ArgumentLength) |
BOOLEAN | OcAppendArgumentsToLoadedImage (IN OUT EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, IN CONST CHAR8 **Arguments, IN UINT32 ArgumentCount, IN BOOLEAN Replace) |
EFI_STATUS | OcRunFirmwareApplication (IN EFI_GUID *ApplicationGuid, IN BOOLEAN SetReason) |
EFI_STATUS EFIAPI | OcPreLocateAudioProtocol (IN OC_PICKER_CONTEXT *Context) |
EFI_STATUS EFIAPI | OcPlayAudioFile (IN OC_PICKER_CONTEXT *Context, IN CONST CHAR8 *BasePath, IN CONST CHAR8 *BaseType, IN BOOLEAN Fallback) |
EFI_STATUS EFIAPI | OcPlayAudioBeep (IN OC_PICKER_CONTEXT *Context, IN UINT32 ToneCount, IN UINT32 ToneLength, IN UINT32 SilenceLength) |
EFI_STATUS EFIAPI | OcPlayAudioEntry (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *Entry) |
VOID EFIAPI | OcToggleVoiceOver (IN OC_PICKER_CONTEXT *Context, IN CONST CHAR8 *BasePath OPTIONAL, IN CONST CHAR8 *BaseType OPTIONAL) |
UINT16 * | OcGetBootOrder (IN EFI_GUID *BootVariableGuid, IN BOOLEAN WithBootNext, OUT UINTN *BootOrderCount, OUT BOOLEAN *Deduplicated OPTIONAL, OUT BOOLEAN *HasBootNext OPTIONAL, IN BOOLEAN UseBootNextOnly) |
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) |
VOID | OcImageLoaderInit (IN CONST BOOLEAN ProtectUefiServices, IN CONST BOOLEAN FixupAppleEfiImages) |
VOID | OcImageLoaderActivate (VOID) |
VOID | OcImageLoaderRegisterPatch (IN OC_IMAGE_LOADER_PATCH Patch OPTIONAL) |
VOID | OcImageLoaderRegisterConfigure (IN OC_IMAGE_LOADER_CONFIGURE Configure OPTIONAL) |
EFI_STATUS EFIAPI | OcImageLoaderLoad (IN BOOLEAN BootPolicy, IN EFI_HANDLE ParentImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize, OUT EFI_HANDLE *ImageHandle) |
EFI_STATUS | OcParseLoadOptions (IN CONST EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, OUT OC_FLEX_ARRAY **ParsedVars) |
EFI_STATUS | OcParseVars (IN VOID *StrVars, OUT OC_FLEX_ARRAY **ParsedVars, IN CONST OC_STRING_FORMAT StringFormat, IN CONST BOOLEAN TokensOnly) |
OC_PARSED_VAR * | OcParsedVarsItemAt (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST UINTN Index) |
BOOLEAN | OcParsedVarsGetStr (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST VOID *Name, OUT VOID **StrValue, IN CONST OC_STRING_FORMAT StringFormat) |
BOOLEAN | OcParsedVarsGetUnicodeStr (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST CHAR16 *Name, OUT CHAR16 **StrValue) |
BOOLEAN | OcParsedVarsGetAsciiStr (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST CHAR8 *Name, OUT CHAR8 **StrValue) |
BOOLEAN | OcHasParsedVar (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST VOID *Name, IN CONST OC_STRING_FORMAT StringFormat) |
EFI_STATUS | OcParsedVarsGetInt (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST VOID *Name, OUT UINTN *Value, IN CONST OC_STRING_FORMAT StringFormat) |
EFI_STATUS | OcParsedVarsGetGuid (IN CONST OC_FLEX_ARRAY *ParsedVars, IN CONST VOID *Name, OUT EFI_GUID *Value, IN CONST OC_STRING_FORMAT StringFormat) |
VOID | OcLocateBootEntryProtocolHandles (IN OUT EFI_HANDLE **EntryProtocolHandles, IN OUT UINTN *EntryProtocolHandleCount) |
VOID | OcFreeBootEntryProtocolHandles (EFI_HANDLE **EntryProtocolHandles) |
EFI_STATUS | OcAddEntriesFromBootEntryProtocol (IN OUT OC_BOOT_CONTEXT *BootContext, IN OUT OC_BOOT_FILESYSTEM *FileSystem, IN EFI_HANDLE *EntryProtocolHandles, IN UINTN EntryProtocolHandleCount, IN CONST VOID *DefaultEntryId, OPTIONAL IN BOOLEAN CreateDefault, IN BOOLEAN CreateForHotKey) |
EFI_STATUS | OcUnlockAppleFirmwareUI (VOID) |
EFI_STATUS | OcLaunchAppleBootPicker (VOID) |
EFI_STATUS EFIAPI | OcGetBootEntryFileFromDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *FileName, IN CONST CHAR8 *DebugFileType, IN UINT32 MaxFileSize, IN UINT32 MinFileSize, OUT VOID **FileData, OUT UINT32 *DataLength OPTIONAL, IN BOOLEAN SearchAtLeaf, IN BOOLEAN SearchAtRoot) |
EFI_STATUS EFIAPI | OcGetBootEntryFile (IN OC_BOOT_ENTRY *BootEntry, IN CONST CHAR16 *FileName, IN CONST CHAR8 *DebugFileType, IN UINT32 MaxFileSize, IN UINT32 MinFileSize, OUT VOID **FileData, OUT UINT32 *DataLength OPTIONAL, IN BOOLEAN SearchAtLeaf, IN BOOLEAN SearchAtRoot) |
EFI_STATUS EFIAPI | OcResetToFirmwareSettingsSupported (VOID) |
EFI_STATUS EFIAPI | OcResetSystem (IN CHAR16 *Mode) |
Copyright (C) 2019-2022, vit9696, mikebeaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file OcBootManagementLib.h.
#define HIBERNATE_MODE_NONE 0U |
Hibernate detection bit mask for hibernate source usage.
Definition at line 1164 of file OcBootManagementLib.h.
#define HIBERNATE_MODE_NVRAM 2U |
Definition at line 1166 of file OcBootManagementLib.h.
#define HIBERNATE_MODE_RTC 1U |
Definition at line 1165 of file OcBootManagementLib.h.
#define MAX_LOAD_OPTIONS_SIZE SIZE_16KB |
Definition at line 1582 of file OcBootManagementLib.h.
#define OC_ATTR_ALL_BITS |
Definition at line 123 of file OcBootManagementLib.h.
#define OC_ATTR_HIDE_THEMED_ICONS BIT3 |
Definition at line 116 of file OcBootManagementLib.h.
#define OC_ATTR_REDUCE_MOTION BIT9 |
Definition at line 122 of file OcBootManagementLib.h.
#define OC_ATTR_SHOW_DEBUG_DISPLAY BIT5 |
Definition at line 118 of file OcBootManagementLib.h.
#define OC_ATTR_USE_DISK_LABEL_FILE BIT1 |
Definition at line 114 of file OcBootManagementLib.h.
#define OC_ATTR_USE_FLAVOUR_ICON BIT7 |
Definition at line 120 of file OcBootManagementLib.h.
#define OC_ATTR_USE_GENERIC_LABEL_IMAGE BIT2 |
Definition at line 115 of file OcBootManagementLib.h.
#define OC_ATTR_USE_MINIMAL_UI BIT6 |
Definition at line 119 of file OcBootManagementLib.h.
#define OC_ATTR_USE_POINTER_CONTROL BIT4 |
Definition at line 117 of file OcBootManagementLib.h.
#define OC_ATTR_USE_REVERSED_UI BIT8 |
Definition at line 121 of file OcBootManagementLib.h.
#define OC_ATTR_USE_VOLUME_ICON BIT0 |
Attributes supported by the interfaces.
Definition at line 113 of file OcBootManagementLib.h.
#define OC_BOOT_APPLE_ANY (OC_BOOT_APPLE_OS | OC_BOOT_APPLE_RECOVERY | OC_BOOT_APPLE_TIME_MACHINE | OC_BOOT_APPLE_FW_UPDATE) |
Definition at line 161 of file OcBootManagementLib.h.
#define OC_BOOT_APPLE_FW_UPDATE BIT4 |
Definition at line 160 of file OcBootManagementLib.h.
#define OC_BOOT_APPLE_OS BIT1 |
Definition at line 157 of file OcBootManagementLib.h.
#define OC_BOOT_APPLE_RECOVERY BIT2 |
Definition at line 158 of file OcBootManagementLib.h.
#define OC_BOOT_APPLE_TIME_MACHINE BIT3 |
Definition at line 159 of file OcBootManagementLib.h.
#define OC_BOOT_EXTERNAL_OS BIT6 |
Definition at line 163 of file OcBootManagementLib.h.
#define OC_BOOT_EXTERNAL_TOOL BIT7 |
Definition at line 164 of file OcBootManagementLib.h.
#define OC_BOOT_SYSTEM BIT8 |
Definition at line 165 of file OcBootManagementLib.h.
#define OC_BOOT_UNKNOWN BIT0 |
Definition at line 156 of file OcBootManagementLib.h.
#define OC_BOOT_UNMANAGED BIT9 |
Definition at line 166 of file OcBootManagementLib.h.
#define OC_BOOT_WINDOWS BIT5 |
Definition at line 162 of file OcBootManagementLib.h.
#define OC_FLAVOUR_APPLE_FW "AppleRecv:Apple" |
Definition at line 88 of file OcBootManagementLib.h.
#define OC_FLAVOUR_APPLE_OS "Apple" |
Definition at line 86 of file OcBootManagementLib.h.
#define OC_FLAVOUR_APPLE_RECOVERY "AppleRecv:Apple" |
Definition at line 87 of file OcBootManagementLib.h.
#define OC_FLAVOUR_APPLE_TIME_MACHINE "AppleTM:Apple" |
Definition at line 89 of file OcBootManagementLib.h.
#define OC_FLAVOUR_AUTO "Auto" |
Predefined flavours.
Definition at line 76 of file OcBootManagementLib.h.
#define OC_FLAVOUR_FIRMWARE_SETTINGS "FirmwareSettings" |
Definition at line 81 of file OcBootManagementLib.h.
#define OC_FLAVOUR_HTTP_BOOT4 "HttpBoot4:HttpBoot:NetworkBoot" |
Definition at line 82 of file OcBootManagementLib.h.
#define OC_FLAVOUR_HTTP_BOOT6 "HttpBoot6:HttpBoot:NetworkBoot" |
Definition at line 83 of file OcBootManagementLib.h.
#define OC_FLAVOUR_ID_FIRMWARE_SETTINGS "FirmwareSettings" |
Definition at line 99 of file OcBootManagementLib.h.
#define OC_FLAVOUR_ID_NETWORK_BOOT "NetworkBoot" |
Definition at line 100 of file OcBootManagementLib.h.
#define OC_FLAVOUR_ID_RESET_NVRAM "ResetNVRAM" |
Predefined flavour ids.
Definition at line 95 of file OcBootManagementLib.h.
#define OC_FLAVOUR_ID_TOGGLE_SIP_DISABLED "ToggleSIP_Disabled" |
Definition at line 98 of file OcBootManagementLib.h.
#define OC_FLAVOUR_ID_TOGGLE_SIP_ENABLED "ToggleSIP_Enabled" |
Definition at line 97 of file OcBootManagementLib.h.
#define OC_FLAVOUR_ID_UEFI_SHELL "UEFIShell" |
Definition at line 96 of file OcBootManagementLib.h.
#define OC_FLAVOUR_PXE_BOOT4 "PxeBoot4:PxeBoot:NetworkBoot" |
Definition at line 84 of file OcBootManagementLib.h.
#define OC_FLAVOUR_PXE_BOOT6 "PxeBoot6:PxeBoot:NetworkBoot" |
Definition at line 85 of file OcBootManagementLib.h.
#define OC_FLAVOUR_RESET_NVRAM "ResetNVRAM:NVRAMTool" |
Definition at line 77 of file OcBootManagementLib.h.
#define OC_FLAVOUR_TOGGLE_SIP "ToggleSIP:NVRAMTool" |
Definition at line 78 of file OcBootManagementLib.h.
#define OC_FLAVOUR_TOGGLE_SIP_DISABLED "ToggleSIP_Disabled:ToggleSIP:NVRAMTool" |
Definition at line 80 of file OcBootManagementLib.h.
#define OC_FLAVOUR_TOGGLE_SIP_ENABLED "ToggleSIP_Enabled:ToggleSIP:NVRAMTool" |
Definition at line 79 of file OcBootManagementLib.h.
#define OC_FLAVOUR_WINDOWS "Windows" |
Definition at line 90 of file OcBootManagementLib.h.
#define OC_INPUT_ABORTED -1 |
Esc or 0.
Definition at line 1425 of file OcBootManagementLib.h.
#define OC_INPUT_BOTTOM -10 |
Move to bottom.
Definition at line 1434 of file OcBootManagementLib.h.
#define OC_INPUT_CONTINUE -4 |
Continue (press enter)
Definition at line 1428 of file OcBootManagementLib.h.
#define OC_INPUT_DOWN -6 |
Move down.
Definition at line 1430 of file OcBootManagementLib.h.
#define OC_INPUT_FUNCTIONAL | ( | x | ) |
#define OC_INPUT_INTERNAL -13 |
Accepted internal hotkey (e.g. Apple)
Definition at line 1437 of file OcBootManagementLib.h.
#define OC_INPUT_LEFT -7 |
Move left.
Definition at line 1431 of file OcBootManagementLib.h.
#define OC_INPUT_MAX L_STR_LEN (OC_INPUT_STR) |
Definition at line 1424 of file OcBootManagementLib.h.
#define OC_INPUT_MORE -11 |
Show more entries (press space)
Definition at line 1435 of file OcBootManagementLib.h.
#define OC_INPUT_NO_ACTION -2 |
Some other key.
Definition at line 1426 of file OcBootManagementLib.h.
#define OC_INPUT_RIGHT -8 |
Move right.
Definition at line 1432 of file OcBootManagementLib.h.
#define OC_INPUT_STR "123456789ABCDEFGHIJKLMNOPQRSTUVXWZ" |
Key index mappings. Non-negative values may also be returned to request a specific zero-indexed boot entry.
Definition at line 1423 of file OcBootManagementLib.h.
#define OC_INPUT_SWITCH_FOCUS -19 |
Switch UI focus (tab and shift+tab)
Definition at line 1443 of file OcBootManagementLib.h.
#define OC_INPUT_TIMEOUT -3 |
Timeout.
Definition at line 1427 of file OcBootManagementLib.h.
#define OC_INPUT_TOP -9 |
Move to top.
Definition at line 1433 of file OcBootManagementLib.h.
#define OC_INPUT_TYPING_BACKSPACE -15 |
Clear last typed character while typing (press backspace)
Definition at line 1439 of file OcBootManagementLib.h.
#define OC_INPUT_TYPING_CLEAR_ALL -14 |
Clear current input while typing (press esc)
Definition at line 1438 of file OcBootManagementLib.h.
#define OC_INPUT_TYPING_CONFIRM -18 |
Confirm input while typing (press enter)
Definition at line 1442 of file OcBootManagementLib.h.
#define OC_INPUT_TYPING_LEFT -16 |
Move left while typing (UI does not have to support)
Definition at line 1440 of file OcBootManagementLib.h.
#define OC_INPUT_TYPING_RIGHT -17 |
Move right while typing (UI does not have to support)
Definition at line 1441 of file OcBootManagementLib.h.
#define OC_INPUT_UP -5 |
Move up.
Definition at line 1429 of file OcBootManagementLib.h.
#define OC_INPUT_VOICE_OVER -12 |
Toggle VoiceOver (press CMD+F5)
Definition at line 1436 of file OcBootManagementLib.h.
#define OC_KERN_CAPABILITY_ALL (OC_KERN_CAPABILITY_K32_U32 | OC_KERN_CAPABILITY_K32_K64_U64) |
Definition at line 197 of file OcBootManagementLib.h.
#define OC_KERN_CAPABILITY_K32_K64_U64 (OC_KERN_CAPABILITY_K32_U64 | OC_KERN_CAPABILITY_K64_U64) |
Definition at line 195 of file OcBootManagementLib.h.
#define OC_KERN_CAPABILITY_K32_U32 BIT0 |
Supports K32 and U32 (10.4~10.6)
macOS Kernel capabilities. Written in pairs of kernel and user capabilities.
On IA32 firmware: 10.4-10.5 - K32_U32 | K32_U64. 10.6 - K32_U32 | K32_U64. 10.7+ - K32_U64.
On X64 firmware: 10.4-10.5 - K32_U32 | K32_U64. 10.6 - K32_U32 | K32_U64 | K64_U64. 10.7+ - K32_U64 | K64_U64.
Definition at line 191 of file OcBootManagementLib.h.
#define OC_KERN_CAPABILITY_K32_U32_U64 (OC_KERN_CAPABILITY_K32_U32 | OC_KERN_CAPABILITY_K32_U64) |
Definition at line 196 of file OcBootManagementLib.h.
#define OC_KERN_CAPABILITY_K32_U64 BIT1 |
Supports K32 and U64 (10.4~10.7)
Definition at line 192 of file OcBootManagementLib.h.
#define OC_KERN_CAPABILITY_K64_U64 BIT2 |
Supports K64 and U64 (10.6+)
Definition at line 193 of file OcBootManagementLib.h.
#define OC_MAX_CONTENT_VISIBILITY_SIZE 512 |
Maximum allowed .contentVisibility
file size.
Definition at line 43 of file OcBootManagementLib.h.
#define OC_MAX_INSTANCE_IDENTIFIER_SIZE 64 |
Maximum safe instance identifier size.
Definition at line 38 of file OcBootManagementLib.h.
#define OC_MENU_BOOT_MENU L"OpenCore Boot Menu" |
Default strings for use in the interfaces.
Definition at line 58 of file OcBootManagementLib.h.
#define OC_MENU_CHOOSE_OS L"Choose the Operating System: " |
Definition at line 63 of file OcBootManagementLib.h.
#define OC_MENU_DISK_IMAGE L" (dmg)" |
Definition at line 69 of file OcBootManagementLib.h.
#define OC_MENU_EXTERNAL L" (external)" |
Definition at line 68 of file OcBootManagementLib.h.
#define OC_MENU_OK L"OK" |
Definition at line 67 of file OcBootManagementLib.h.
#define OC_MENU_PASSWORD_PROCESSING L"Verifying password..." |
Definition at line 61 of file OcBootManagementLib.h.
#define OC_MENU_PASSWORD_REQUEST L"Password: " |
Definition at line 60 of file OcBootManagementLib.h.
#define OC_MENU_PASSWORD_RETRY_LIMIT L"Password retry limit exceeded." |
Definition at line 62 of file OcBootManagementLib.h.
#define OC_MENU_RELOADING L"Reloading" |
Definition at line 65 of file OcBootManagementLib.h.
#define OC_MENU_RESTART L"Restarting" |
Definition at line 71 of file OcBootManagementLib.h.
#define OC_MENU_SHOW_AUXILIARY L"Show Auxiliary" |
Definition at line 64 of file OcBootManagementLib.h.
#define OC_MENU_SHUTDOWN L"Shutting Down" |
Definition at line 70 of file OcBootManagementLib.h.
#define OC_MENU_TIMEOUT L"Timeout" |
Definition at line 66 of file OcBootManagementLib.h.
#define OC_MENU_UEFI_SHELL_ENTRY L"UEFI Shell" |
Definition at line 59 of file OcBootManagementLib.h.
#define OC_MODIFIERS_NONE 0 |
Modifier mappings.
Definition at line 1449 of file OcBootManagementLib.h.
#define OC_MODIFIERS_REVERSE_SWITCH_FOCUS BIT1 |
Definition at line 1451 of file OcBootManagementLib.h.
#define OC_MODIFIERS_SET_DEFAULT BIT0 |
Definition at line 1450 of file OcBootManagementLib.h.
#define OC_PICKER_KEYS_FOR_PICKER (OC_PICKER_KEYS_HOTKEYS | OC_PICKER_KEYS_VOICE_OVER | OC_PICKER_KEYS_TAB_CONTROL) |
Definition at line 1461 of file OcBootManagementLib.h.
#define OC_PICKER_KEYS_FOR_TYPING (OC_PICKER_KEYS_TYPING | OC_PICKER_KEYS_VOICE_OVER | OC_PICKER_KEYS_TAB_CONTROL) |
Definition at line 1458 of file OcBootManagementLib.h.
#define OC_PICKER_KEYS_HOTKEYS BIT1 |
Definition at line 1454 of file OcBootManagementLib.h.
#define OC_PICKER_KEYS_TAB_CONTROL BIT3 |
Definition at line 1456 of file OcBootManagementLib.h.
#define OC_PICKER_KEYS_TYPING BIT0 |
Definition at line 1453 of file OcBootManagementLib.h.
#define OC_PICKER_KEYS_VOICE_OVER BIT2 |
Definition at line 1455 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_ATAPI BIT20 |
Allow scanning ATAPI devices.
Definition at line 273 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_FIREWIRE BIT22 |
Allow scanning FireWire devices.
Definition at line 283 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_NVME BIT19 |
Allow scanning NVMe devices.
Definition at line 268 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_PCI BIT24 |
Allow scanning PCI devices (e.g. virtio).
Definition at line 293 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_SASEX BIT17 |
Allow scanning SAS and Mac NVMe devices.
Definition at line 258 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_SATA BIT16 |
Allow scanning SATA devices.
Definition at line 253 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_SCSI BIT18 |
Allow scanning SCSI devices.
Definition at line 263 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_SDCARD BIT23 |
Allow scanning SD card devices.
Definition at line 288 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_DEVICE_USB BIT21 |
Allow scanning USB devices.
Definition at line 278 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_APFS BIT8 |
Allow scanning APFS filesystems.
Definition at line 216 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_ESP BIT10 |
Allow scanning ESP filesystems.
Definition at line 226 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_HFS BIT9 |
Allow scanning HFS filesystems.
Definition at line 221 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_LINUX_DATA BIT13 |
Allow scanning Linux Data filesystems. https://systemd.io/DISCOVERABLE_PARTITIONS/
Definition at line 243 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_LINUX_ROOT BIT12 |
Allow scanning Linux Root filesystems. https://systemd.io/DISCOVERABLE_PARTITIONS/
Definition at line 237 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_NTFS BIT11 |
Allow scanning NTFS filesystems.
Definition at line 231 of file OcBootManagementLib.h.
#define OC_SCAN_ALLOW_FS_XBOOTLDR BIT14 |
Allow scanning XBOOTLDR filesystems.
Definition at line 248 of file OcBootManagementLib.h.
#define OC_SCAN_DEFAULT_POLICY |
By default allow booting from APFS from internal drives.
Definition at line 316 of file OcBootManagementLib.h.
#define OC_SCAN_DEVICE_BITS |
All device bits used by OC_SCAN_DEVICE_LOCK.
Definition at line 298 of file OcBootManagementLib.h.
#define OC_SCAN_DEVICE_LOCK BIT1 |
Perform filtering based on device basis. Ignores all devices by default. Remove this bit to allow any device type.
Definition at line 211 of file OcBootManagementLib.h.
#define OC_SCAN_FILE_SYSTEM_BITS |
All file system bits used by OC_SCAN_FILE_SYSTEM_LOCK.
Definition at line 308 of file OcBootManagementLib.h.
#define OC_SCAN_FILE_SYSTEM_LOCK BIT0 |
Perform filtering based on file system basis. Ignores all filesystems by default. Remove this bit to allow any file system.
Definition at line 204 of file OcBootManagementLib.h.
#define OC_TRACE_PARSE_VARS DEBUG_VERBOSE |
Definition at line 32 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_IDLE_TIMEOUT_MS 700 |
Experimental, less is problematic.
Default timeout for IDLE timeout during menu picker navigation before VoiceOver toggle.
Definition at line 134 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNAL_ERROR_MS 1000 |
Definition at line 145 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNAL_NORMAL_MS 200 |
From boot.efi, constant.
Default VoiceOver BeepGen protocol values.
Definition at line 139 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNALS_ERROR 1 |
Password verification error or boot failure.
Definition at line 147 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNALS_HWERROR 3 |
Hardware error.
Definition at line 148 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNALS_NORMAL 1 |
Username prompt or any input for boot.efi.
Definition at line 141 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNALS_PASSWORD 2 |
Password prompt for boot.efi.
Definition at line 142 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SIGNALS_PASSWORD_OK 3 |
Password correct for boot.efi.
Definition at line 143 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SILENCE_ERROR_MS 150 |
Definition at line 146 of file OcBootManagementLib.h.
#define OC_VOICE_OVER_SILENCE_NORMAL_MS 150 |
From boot.efi, constant.
Definition at line 140 of file OcBootManagementLib.h.
#define OPEN_CORE_AUDIO_PATH L"Resources\\Audio\\" |
Definition at line 107 of file OcBootManagementLib.h.
#define OPEN_CORE_FONT_PATH L"Resources\\Font\\" |
Definition at line 108 of file OcBootManagementLib.h.
#define OPEN_CORE_IMAGE_PATH L"Resources\\Image\\" |
Paths allowed to be accessible by the interfaces.
Definition at line 105 of file OcBootManagementLib.h.
#define OPEN_CORE_LABEL_PATH L"Resources\\Label\\" |
Definition at line 106 of file OcBootManagementLib.h.
typedef struct OC_BOOT_ARGUMENTS_ OC_BOOT_ARGUMENTS |
Unified structure to hold macOS kernel boot arguments to make the code independent of their format version. Several values need changing by other libraries, so values are often pointers to original fields.
typedef struct OC_BOOT_CONTEXT_ OC_BOOT_CONTEXT |
Boot context containing boot filesystems.
typedef struct OC_BOOT_ENTRY_ OC_BOOT_ENTRY |
Forward declaration of OC_BOOT_ENTRY structure.
Definition at line 364 of file OcBootManagementLib.h.
typedef UINT32 OC_BOOT_ENTRY_TYPE |
Operating system boot type. This flags the inferred type, but it is not definitive and should not be relied upon for security.
Definition at line 154 of file OcBootManagementLib.h.
typedef struct OC_BOOT_FILESYSTEM_ OC_BOOT_FILESYSTEM |
Boot filesystem containing boot entries.
Definition at line 538 of file OcBootManagementLib.h.
typedef EFI_STATUS(* OC_BOOT_SYSTEM_ACTION) (IN OUT OC_PICKER_CONTEXT *PickerContext) |
Action to perform as part of executing a system boot entry.
Definition at line 336 of file OcBootManagementLib.h.
typedef EFI_STATUS(* OC_BOOT_UNMANAGED_ACTION) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
Action to perform as part of executing an unmanaged boot entry.
Definition at line 345 of file OcBootManagementLib.h.
typedef EFI_STATUS(* OC_BOOT_UNMANAGED_GET_FINAL_DP) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath) |
Get Device Path for unmanaged boot entry.
Definition at line 355 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_CUSTOM_FREE) (IN VOID *CustomFreeContext) |
Exposed custom entry interface to free any custom items after load.
Definition at line 389 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_CUSTOM_READ) (IN OC_STORAGE_CONTEXT *Storage, IN OC_BOOT_ENTRY *ChosenEntry, OUT VOID **Data, OUT UINT32 *DataSize, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *StorageHandle, OUT EFI_DEVICE_PATH_PROTOCOL **StoragePath, IN OC_DMG_LOADING_SUPPORT DmgLoading, OUT OC_APPLE_DISK_IMAGE_PRELOAD_CONTEXT *DmgPreloadContext, OUT VOID **CustomFreeContext) |
Exposed custom entry load interface. Returns allocated file buffer from pool on success.
Definition at line 371 of file OcBootManagementLib.h.
typedef VOID(EFIAPI * OC_FLUSH_TYPING_BUFFER) (IN OUT OC_PICKER_CONTEXT *Context) |
Flush picker typing buffer.
Definition at line 817 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_GET_ENTRY_ICON) (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, OUT VOID **ImageData, OUT UINT32 *DataLength) |
Get icon contents (e.g. '.VolumeIcon.icns').
Definition at line 773 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_GET_ENTRY_LABEL_IMAGE) (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN UINT8 Scale, OUT VOID **ImageData, OUT UINT32 *DataLength) |
Get label contents (e.g. '.disk_label' or '.disk_label_2x').
Definition at line 760 of file OcBootManagementLib.h.
typedef VOID(EFIAPI * OC_GET_KEY_INFO) (IN OUT OC_PICKER_CONTEXT *Context, IN OC_PICKER_KEY_MAP KeyFilter, OUT OC_PICKER_KEY_INFO *PickerKeyInfo) |
Get picker pressed key info.
Definition at line 785 of file OcBootManagementLib.h.
typedef UINT64(EFIAPI * OC_GET_KEY_WAIT_END_TIME) (IN UINT64 Timeout) |
Request end time in units appropriate for OC_WAIT_FOR_KEY_INFO.
Definition at line 796 of file OcBootManagementLib.h.
typedef struct OC_HOTKEY_CONTEXT_ OC_HOTKEY_CONTEXT |
Picker keyboard handling context.
Definition at line 53 of file OcBootManagementLib.h.
typedef VOID(* OC_IMAGE_LOADER_CONFIGURE) (IN OUT EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, IN UINT32 Capabilities) |
Image loader callback triggered before StartImage.
Definition at line 1889 of file OcBootManagementLib.h.
typedef VOID(* OC_IMAGE_LOADER_PATCH) (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN VOID *SourceBuffer, IN UINTN SourceSize) |
Image loader callback triggered before LoadImage.
Definition at line 1878 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_IMAGE_START) (IN OC_BOOT_ENTRY *ChosenEntry, IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData OPTIONAL, IN BOOLEAN LaunchInText) |
Exposed start interface with chosen boot entry but otherwise equivalent to EFI_BOOT_SERVICES StartImage.
Definition at line 605 of file OcBootManagementLib.h.
typedef VOID(EFIAPI * OC_KB_DEBUG_INSTRUMENT_LOOP_DELAY) (UINT64 LoopDelayStart, UINT64 LoopDelayEnd) |
Instrument kb loop delay.
[in] | LoopDelayStart | Delay start in TSC asm ticks. |
[in] | LoopDelayEnd | Delay end in TSC asm ticks. |
Definition at line 885 of file OcBootManagementLib.h.
typedef VOID(EFIAPI * OC_KB_DEBUG_SHOW) (UINTN NumKeysDown, UINTN NumKeysHeld, APPLE_MODIFIER_MAP Modifiers) |
Running display of held keys.
[in] | NumKeysDown | Number of keys that went down. |
[in] | NumKeysHeld | Number of keys held. |
[in] | Modifiers | Key modifiers. |
Definition at line 899 of file OcBootManagementLib.h.
typedef INTN OC_KEY_CODE |
OC picker codes.
Definition at line 712 of file OcBootManagementLib.h.
typedef UINT16 OC_MODIFIER_MAP |
OC picker modifiers.
Definition at line 717 of file OcBootManagementLib.h.
typedef union OC_PARSED_VAR_ OC_PARSED_VAR |
typedef struct OC_PARSED_VAR_ASCII_ OC_PARSED_VAR_ASCII |
Parsed load option or shell variable.
typedef struct OC_PARSED_VAR_UNICODE_ OC_PARSED_VAR_UNICODE |
typedef struct OC_PICKER_CONTEXT_ OC_PICKER_CONTEXT |
Primary picker context.
Definition at line 48 of file OcBootManagementLib.h.
typedef UINTN OC_PICKER_KEY_MAP |
OC picker modifiers.
Definition at line 722 of file OcBootManagementLib.h.
typedef enum OC_PICKER_MODE_ OC_PICKER_MODE |
Picker mode.
typedef EFI_STATUS(EFIAPI * OC_PLAY_AUDIO_BEEP) (IN OC_PICKER_CONTEXT *Context, IN UINT32 ToneCount, IN UINT32 ToneLength, IN UINT32 SilenceLength) |
Generate cycles of beep signals for context with silence afterwards, blocking.
Definition at line 838 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_PLAY_AUDIO_ENTRY) (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *Entry) |
Play audio entry for context.
Definition at line 850 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_PLAY_AUDIO_FILE) (IN OC_PICKER_CONTEXT *Context, IN CONST CHAR8 *BasePath, IN CONST CHAR8 *BaseType, IN BOOLEAN Fallback) |
Play audio file for context.
Definition at line 826 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_REQ_PRIVILEGE) (IN OC_PICKER_CONTEXT *Context, IN OC_PRIVILEGE_LEVEL Level) |
Request a privilege escalation, for example by prompting for a password.
Definition at line 739 of file OcBootManagementLib.h.
typedef EFI_STATUS(EFIAPI * OC_SHOW_MENU) (IN OC_BOOT_CONTEXT *BootContext, IN OC_BOOT_ENTRY **BootEntries, OUT OC_BOOT_ENTRY **ChosenBootEntry) |
Display entries onscreen.
Definition at line 749 of file OcBootManagementLib.h.
typedef VOID(EFIAPI * OC_TOGGLE_VOICE_OVER) (IN OC_PICKER_CONTEXT *Context, IN CONST CHAR8 *BasePath OPTIONAL, IN CONST CHAR8 *BaseType OPTIONAL) |
Toggle VoiceOver support.
Definition at line 860 of file OcBootManagementLib.h.
typedef BOOLEAN(EFIAPI * OC_VERIFY_PASSWORD) (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST OC_PRIVILEGE_CONTEXT *PrivilegeContext) |
Password verification.
Definition at line 922 of file OcBootManagementLib.h.
typedef BOOLEAN(EFIAPI * OC_WAIT_FOR_KEY_INFO) (IN OUT OC_PICKER_CONTEXT *Context, IN UINT64 EndTime, IN OC_PICKER_KEY_MAP KeyFilter, IN OUT OC_PICKER_KEY_INFO *PickerKeyInfo) |
Wait for picker pressed key info. Use zero EndTime for no timeout.
Definition at line 805 of file OcBootManagementLib.h.
OcLoadBootEntry DMG loading policy rules.
Enumerator | |
---|---|
OcDmgLoadingDisabled | |
OcDmgLoadingAnyImage | |
OcDmgLoadingAppleSigned |
Definition at line 326 of file OcBootManagementLib.h.
enum OC_PICKER_CMD |
Picker behaviour action.
Enumerator | |
---|---|
OcPickerDefault | |
OcPickerShowPicker | |
OcPickerProtocolHotKey | |
OcPickerBootApple | |
OcPickerBootAppleRecovery |
Definition at line 870 of file OcBootManagementLib.h.
enum OC_PICKER_MODE_ |
Picker mode.
Enumerator | |
---|---|
OcPickerModeBuiltin | |
OcPickerModeExternal | |
OcPickerModeApple |
Definition at line 171 of file OcBootManagementLib.h.
enum OC_PRIVILEGE_LEVEL |
Privilege levels to escalate to
Enumerator | |
---|---|
OcPrivilegeUnauthorized | |
OcPrivilegeAuthorized |
Definition at line 704 of file OcBootManagementLib.h.
EFI_STATUS OcActivateHibernateWake | ( | IN UINT32 | HibernateMask | ) |
Handle hibernation detection for later loading.
[in] | HibernateMask | Hibernate detection mask. |
EFI_SUCCESS | Hibernation mode was found and activated. |
Definition at line 31 of file AppleHibernate.c.
EFI_STATUS OcAddEntriesFromBootEntryProtocol | ( | IN OUT OC_BOOT_CONTEXT * | BootContext, |
IN OUT OC_BOOT_FILESYSTEM * | FileSystem, | ||
IN EFI_HANDLE * | EntryProtocolHandles, | ||
IN UINTN | EntryProtocolHandleCount, | ||
IN CONST VOID * | DefaultEntryId, | ||
OPTIONAL IN BOOLEAN | CreateDefault, | ||
IN BOOLEAN | CreateForHotKey ) |
Request bootable entries from installed boot entry protocol drivers.
[in,out] | BootContext | Context of filesystems. |
[in,out] | FileSystem | Filesystem to scan for entries. |
[in] | EntryProtocolHandles | Boot entry protocol handles, or NULL if none. |
[in] | EntryProtocolHandleCount | Count of boot entry protocol handles. |
[in] | DefaultEntryId | Id of saved default entry on this file system. |
[in] | CreateDefault | Create default entry if TRUE, create all others otherwise. |
[in] | CreateForHotKey | If TRUE default entry is being created for protocol hotkey, otherwise for NVRAM boot entry. |
EFI_SUCCESS | At least one entry was created. |
Definition at line 239 of file BootEntryProtocol.c.
BOOLEAN OcAppendArgumentsToLoadedImage | ( | IN OUT EFI_LOADED_IMAGE_PROTOCOL * | LoadedImage, |
IN CONST CHAR8 ** | Arguments, | ||
IN UINT32 | ArgumentCount, | ||
IN BOOLEAN | Replace ) |
Append 1 or more arguments to Loaded Image protocol.
[in,out] | LoadedImage | Loaded Image protocol instance. |
[in] | Arguments | Argument array. |
[in] | ArgumentCount | Number of arguments in the array. |
[in] | Replace | Whether to append to existing arguments or replace. |
TRUE | on success. |
Definition at line 224 of file BootArguments.c.
BOOLEAN OcAppendArgumentToCmd | ( | IN OUT OC_PICKER_CONTEXT *Context | OPTIONAL, |
IN OUT CHAR8 * | CommandLine, | ||
IN CONST CHAR8 * | Argument, | ||
IN CONST UINTN | ArgumentLength ) |
Append argument to command line without deduplication.
[in,out] | Context | Picker context. NULL, if a privilege escalation is not required. |
[in,out] | CommandLine | Argument command line of BOOT_LINE_LENGTH bytes. |
[in] | Argument | Argument, e.g. -v, slide=0, debug=0x100, etc. |
[in] | ArgumentLength | Argument length, e.g. L_STR_LEN ("-v"). |
TRUE | on success. |
Definition at line 184 of file BootArguments.c.
BOOLEAN OcCheckArgumentFromEnv | ( | IN EFI_LOADED_IMAGE *LoadedImage | OPTIONAL, |
IN EFI_GET_VARIABLE GetVariable | OPTIONAL, | ||
IN CONST CHAR8 * | Argument, | ||
IN CONST UINTN | ArgumentLength, | ||
IN OUT CHAR8 **Value | OPTIONAL ) |
Check if boot argument is currently passed (via image options or NVRAM).
[in] | LoadedImage | UEFI loaded image protocol instance, optional. |
[in] | GetVariable | Preferred UEFI NVRAM reader, optional. |
[in] | Argument | Argument, e.g. -v, slide=, debug=, etc. |
[in] | ArgumentLength | Argument length, e.g. L_STR_LEN ("-v"). |
[in,out] | Value | Argument value allocated from pool. |
TRUE | if argument is present. |
Definition at line 298 of file BootArguments.c.
OC_BOOT_ENTRY ** OcEnumerateEntries | ( | IN OC_BOOT_CONTEXT * | BootContext | ) |
Perform boot entry enumeration.
[in] | BootContext | Boot context. |
enumerated | boot entry list allocated from pool. |
Definition at line 2506 of file BootEntryManagement.c.
VOID OcFreeBootContext | ( | IN OUT OC_BOOT_CONTEXT * | Context | ) |
Free boot context.
[in,out] | Context | Boot context to free. |
Definition at line 2000 of file BootEntryManagement.c.
VOID OcFreeBootEntryProtocolHandles | ( | EFI_HANDLE ** | EntryProtocolHandles | ) |
Free boot entry protocol handles.
[in,out] | EntryProtocolHandles | Boot entry protocol handles, or NULL if none. |
Definition at line 57 of file BootEntryProtocol.c.
VOID OcFreeHotKeys | ( | IN OC_PICKER_CONTEXT * | Context | ) |
Free picker keyboard handling resources.
[in] | Context | Picker context. |
Definition at line 812 of file HotKeySupport.c.
EFI_LOADED_IMAGE_PROTOCOL * OcGetAppleBootLoadedImage | ( | IN EFI_HANDLE | ImageHandle | ) |
Get loaded image protocol for Apple bootloader.
[in] | ImageHandle | Image handle. |
loaded | image protocol or NULL for non Apple images. |
Definition at line 441 of file PolicyManagement.c.
CONST CHAR8 * OcGetArgumentFromCmd | ( | IN CONST CHAR8 * | CommandLine, |
IN CONST CHAR8 * | Argument, | ||
IN CONST UINTN | ArgumentLength, | ||
OUT UINTN *ValueLength | OPTIONAL ) |
Get argument value from command line.
[in] | CommandLine | Argument command line, e.g. for boot.efi. |
[in] | Argument | Argument, e.g. -v, slide=, debug=, etc. |
[in] | ArgumentLength | Argument length, e.g. L_STR_LEN ("-v"). |
[out] | ValueLength | Argument value length, optional. |
pointer | to argument value or NULL. |
Definition at line 97 of file BootArguments.c.
OC_BOOT_ENTRY_TYPE OcGetBootDevicePathType | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
OUT BOOLEAN *IsFolder | OPTIONAL, | ||
OUT BOOLEAN *IsGeneric | OPTIONAL ) |
Check if supplied device path contains known names (e.g. Apple bootloader).
[in] | DevicePath | Device path. |
[out] | IsFolder | Device path represents directory, optional. |
[out] | IsGeneric | Device path represents generic booter, optional. |
entry | type for potentially known bootloaders. |
OC_BOOT_UNKNOWN | for unknown bootloaders. |
Definition at line 330 of file PolicyManagement.c.
EFI_STATUS EFIAPI OcGetBootEntryFile | ( | IN OC_BOOT_ENTRY * | BootEntry, |
IN CONST CHAR16 * | FileName, | ||
IN CONST CHAR8 * | DebugFileType, | ||
IN UINT32 | MaxFileSize, | ||
IN UINT32 | MinFileSize, | ||
OUT VOID ** | FileData, | ||
OUT UINT32 *DataLength | OPTIONAL, | ||
IN BOOLEAN | SearchAtLeaf, | ||
IN BOOLEAN | SearchAtRoot ) |
Read boot entry meta-data file. Validates that boot entry is external tool or OS type.
[in] | BootEntry | Boot entry. |
[in] | FileName | File name to search for. |
[in] | DebugFileType | Brief description of file for use in debug messages. |
[in] | MaxFileSize | Maximum allowed file size (inclusive). |
[in] | MinFileSize | Minimum allowed file size (inclusive). |
[out] | FileData | Returned file data. |
[out] | DataLength | Returned data length. |
[in] | SearchAtLeaf | Search next to boot file (or in boot folder) first. |
[in] | SearchAtRoot | After SearchAtLeaf (if specified), search at OC-specific GUID sub-folder location (if present), then at FS root. |
EFI_SUCCESS | Boot entry was correct type, file was located, validated against allowed length, and returned. |
other | Boot entry was incorrect type, or file could not be located, or had invalid length. |
Definition at line 593 of file BootEntryInfo.c.
EFI_STATUS EFIAPI OcGetBootEntryFileFromDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
IN CONST CHAR16 * | FileName, | ||
IN CONST CHAR8 * | DebugFileType, | ||
IN UINT32 | MaxFileSize, | ||
IN UINT32 | MinFileSize, | ||
OUT VOID ** | FileData, | ||
OUT UINT32 *DataLength | OPTIONAL, | ||
IN BOOLEAN | SearchAtLeaf, | ||
IN BOOLEAN | SearchAtRoot ) |
Read boot entry meta-data file from boot entry device path. May be used before before OC_BOOT_ENTRY struct is created.
[in] | DevicePath | Boot entry device path. |
[in] | FileName | File name to search for. |
[in] | DebugFileType | Brief description of file for use in debug messages. |
[in] | MaxFileSize | Maximum allowed file size (inclusive). |
[in] | MinFileSize | Minimum allowed file size (inclusive). |
[out] | FileData | Returned file data. |
[out] | DataLength | Returned data length. |
[in] | SearchAtLeaf | Search next to boot file (or in boot folder) first. |
[in] | SearchAtRoot | After SearchAtLeaf (if specified), search at OC-specific GUID sub-folder location (if present), then at FS root. |
EFI_SUCCESS | File was located, validated against allowed length, and returned. |
other | File could not be located, or had invalid length. |
Definition at line 565 of file BootEntryInfo.c.
EFI_STATUS EFIAPI OcGetBootEntryIcon | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_BOOT_ENTRY * | BootEntry, | ||
OUT VOID ** | ImageData, | ||
OUT UINT32 * | DataLength ) |
Get '.VolumeIcon.icns' file contents, if exists.
[in] | BootEntry | Located boot entry. |
[out] | ImageData | File contents. |
[out] | DataLength | File length. |
EFI_SUCCESS | The file was read successfully. |
Definition at line 420 of file BootEntryInfo.c.
EFI_STATUS EFIAPI OcGetBootEntryLabelImage | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_BOOT_ENTRY * | BootEntry, | ||
IN UINT8 | Scale, | ||
OUT VOID ** | ImageData, | ||
OUT UINT32 * | DataLength ) |
Get '.disk_label' or '.disk_label_2x' file contents, if exists.
[in] | BootEntry | Located boot entry. |
[in] | Scale | User interface scale. |
[out] | ImageData | File contents. |
[out] | DataLength | File length. |
EFI_SUCCESS | The file was read successfully. |
Definition at line 396 of file BootEntryInfo.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.
UINT32 OcGetDefaultBootEntry | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OUT OC_BOOT_ENTRY * | BootEntries, | ||
IN UINTN | NumBootEntries ) |
Obtain default entry from picker context.
[in] | Context | Picker context. |
[in,out] | BootEntries | Described list of entries, may get updated. |
[in] | NumBootEntries | Positive number of boot entries. |
boot | entry or 0. |
UINT32 OcGetDevicePolicyType | ( | IN EFI_HANDLE | Handle, |
OUT BOOLEAN *External | OPTIONAL ) |
Get device scan policy type.
[in] | Handle | Device/partition handle. |
[out] | External | Check whether device is external. |
required | policy or 0 on mismatch. |
Definition at line 45 of file PolicyManagement.c.
UINT32 OcGetFileSystemPolicyType | ( | IN EFI_HANDLE | Handle | ) |
Get file system scan policy type.
[in] | Handle | Partition handle. |
required | policy or 0 on mismatch. |
Definition at line 247 of file PolicyManagement.c.
EFI_STATUS OcHandleRecoveryRequest | ( | OUT EFI_DEVICE_PATH_PROTOCOL **Initiator | OPTIONAL | ) |
Handle recovery detection for later loading. Recovery handling is required to choose the right operating system.
[out] | Initiator | Recovery initiator device path, optional. |
EFI_SUCCESS | Recovery boot is required. |
EFI_NOT_FOUND | System should boot normally. |
Definition at line 73 of file AppleRecovery.c.
BOOLEAN EFIAPI OcHasLoadOptions | ( | IN UINT32 | LoadOptionsSize, |
IN CONST VOID * | LoadOptions ) |
Are load options present as a Unicode string?
[in] | LoadOptionsSize | Load options size. |
[in] | LoadOptions | Load options. |
TRUE | if valid. |
Definition at line 402 of file BootArguments.c.
BOOLEAN OcHasParsedVar | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST VOID * | Name, | ||
IN CONST OC_STRING_FORMAT | StringFormat ) |
Get presence or absence of parsed shell var or load option.
[in] | ParsedVars | Parsed variables. |
[in] | Name | Option name. |
[in] | StringFormat | Are option names and values Unicode or ASCII? |
TRUE | Option exists (with or without a value). |
FALSE | Option not found. |
Definition at line 737 of file BootArguments.c.
VOID OcImageLoaderActivate | ( | VOID | ) |
Make DirectImageLoader the default for Apple Secure Boot.
Definition at line 1242 of file ImageLoader.c.
VOID OcImageLoaderInit | ( | IN CONST BOOLEAN | ProtectUefiServices, |
IN CONST BOOLEAN | FixupAppleEfiImages ) |
Initialises custom Boot Services overrides to support direct images.
Definition at line 1219 of file ImageLoader.c.
EFI_STATUS EFIAPI OcImageLoaderLoad | ( | IN BOOLEAN | BootPolicy, |
IN EFI_HANDLE | ParentImageHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | ||
IN VOID *SourceBuffer | OPTIONAL, | ||
IN UINTN | SourceSize, | ||
OUT EFI_HANDLE * | ImageHandle ) |
Simplified load image routine, which bypasses UEFI and loads the image directly.
[in] | BootPolicy | Ignored. |
[in] | ParentImageHandle | The caller's image handle. |
[in] | DevicePath | Ignored. |
[in] | SourceBuffer | Pointer to the memory location containing image to be loaded. |
[in] | SourceSize | The size in bytes of SourceBuffer. |
[out] | ImageHandle | The pointer to the returned image handle created on success. |
EFI_SUCCESS | on success. |
Definition at line 262 of file ImageLoader.c.
VOID OcImageLoaderRegisterConfigure | ( | IN OC_IMAGE_LOADER_CONFIGURE Configure | OPTIONAL | ) |
Register image start callback.
[in] | Configure | Callback function to call on image start. |
Definition at line 1258 of file ImageLoader.c.
VOID OcImageLoaderRegisterPatch | ( | IN OC_IMAGE_LOADER_PATCH Patch | OPTIONAL | ) |
Register image loading callback.
[in] | Patch | Callback function to call on image load. |
Definition at line 1250 of file ImageLoader.c.
EFI_STATUS OcInitHotKeys | ( | IN OUT OC_PICKER_CONTEXT * | Context | ) |
Initialise picker keyboard handling. Initialises necessary handlers and updates booter context based on this. Call before looped calls to OcWaitForPickerKeyInfo or OcGetPickerKeyInfo.
[in,out] | Context | Picker context. |
EFI_SUCCESS | The keyboard handling within the context has been initialised. |
EFI_NOT_FOUND | Could not find a required protocol. |
other | An error returned by a sub-operation. |
Definition at line 733 of file HotKeySupport.c.
BOOLEAN OcIsAppleHibernateWake | ( | VOID | ) |
Check if active hibernation is happening.
TRUE | on waking from hibernation. |
Definition at line 232 of file AppleHibernate.c.
EFI_STATUS OcLaunchAppleBootPicker | ( | VOID | ) |
Launch Apple boot picker firmware application.
EFI_SUCCESS | Picker was successfully executed, implies boot selection was returned in BootNext. |
other | Picker could not be launched, or error within picker application. |
Definition at line 763 of file OcBootManagementLib.c.
EFI_STATUS OcLoadBootEntry | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_BOOT_ENTRY * | BootEntry, | ||
IN EFI_HANDLE | ParentHandle ) |
Load & start boot entry loader image with given options.
[in] | Context | Picker context. |
[in] | BootEntry | Located boot entry. |
[in] | ParentHandle | Parent image handle. |
EFI_SUCCESS | The image was found, started, and ended succesfully. |
Definition at line 2549 of file BootEntryManagement.c.
VOID OcLoadPickerHotKeys | ( | IN OUT OC_PICKER_CONTEXT * | Context | ) |
Check pressed hotkeys and update booter context based on this.
[in,out] | Context | Picker context. |
Definition at line 109 of file HotKeySupport.c.
VOID OcLocateBootEntryProtocolHandles | ( | IN OUT EFI_HANDLE ** | EntryProtocolHandles, |
IN OUT UINTN * | EntryProtocolHandleCount ) |
Locate boot entry protocol handles.
[in,out] | EntryProtocolHandles | Boot entry protocol handles, or NULL if none. |
[in,out] | EntryProtocolHandleCount | Count of boot entry protocol handles. |
Definition at line 28 of file BootEntryProtocol.c.
VOID OcParseBootArgs | ( | OUT OC_BOOT_ARGUMENTS * | Arguments, |
IN VOID * | BootArgs ) |
Parse macOS kernel into unified boot arguments structure.
[out] | Arguments | Unified boot arguments structure. |
[in] | BootArgs | Kernel boot arguments strucutre. |
Definition at line 43 of file BootArguments.c.
BOOLEAN OcParsedVarsGetAsciiStr | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST CHAR8 * | Name, | ||
OUT CHAR8 ** | StrValue ) |
Get ASCII string value of parsed var or load option. Return value points directly into original raw option memory, so may need to be copied if it is to be retained, and must not be freed directly.
[in] | ParsedVars | Parsed variables. |
[in] | Name | Option name. |
[in] | StrValue | Option value if successful, not modified otherwise; note that NULL is returned if option exists with no value. Caller must not attempt to free this memory. |
TRUE | Option exists. |
FALSE | Option not found. |
Definition at line 727 of file BootArguments.c.
EFI_STATUS OcParsedVarsGetGuid | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST VOID * | Name, | ||
OUT EFI_GUID * | Value, | ||
IN CONST OC_STRING_FORMAT | StringFormat ) |
Get guid value of parsed shell var or load option.
[in] | ParsedVars | Parsed variables. |
[in] | Name | Option name. |
[in] | Value | Option value if successful, not modified otherwise. |
[in] | StringFormat | Are option names and values Unicode or ASCII? |
EFI_SUCCESS | Success. |
EFI_NOT_FOUND | Option not found, or has no value. |
other | Error encountered when parsing option as guid. |
Definition at line 785 of file BootArguments.c.
EFI_STATUS OcParsedVarsGetInt | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST VOID * | Name, | ||
OUT UINTN * | Value, | ||
IN CONST OC_STRING_FORMAT | StringFormat ) |
Get integer value of parsed shell var or load option (parses hex and decimal representations).
[in] | ParsedVars | Parsed variables. |
[in] | Name | Option name. |
[in] | Value | Option value if successful, not modified otherwise. |
[in] | StringFormat | Are option names and values Unicode or ASCII? |
EFI_SUCCESS | Success. |
EFI_NOT_FOUND | Option not found, or has no value. |
other | Error encountered when parsing option as int. |
Definition at line 749 of file BootArguments.c.
BOOLEAN OcParsedVarsGetStr | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST VOID * | Name, | ||
OUT VOID ** | StrValue, | ||
IN CONST OC_STRING_FORMAT | StringFormat ) |
Get string value of parsed var or load option. Returned value is in same format as raw options. Return value points directly into original raw option memory, so may need to be copied if it is to be retained, and must not be freed directly.
[in] | ParsedVars | Parsed variables. |
[in] | Name | Option name. |
[in] | StrValue | Option value if successful, not modified otherwise; note that NULL is returned if option exists with no value. Caller must not attempt to free this memory. |
[in] | StringFormat | Are option names and values Unicode or ASCII? |
TRUE | Option exists. |
FALSE | Option not found. |
Definition at line 669 of file BootArguments.c.
BOOLEAN OcParsedVarsGetUnicodeStr | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST CHAR16 * | Name, | ||
OUT CHAR16 ** | StrValue ) |
Get string value of parsed var or load option. Return value points directly into original raw option memory, so may need to be copied if it is to be retained, and must not be freed directly.
[in] | ParsedVars | Parsed variables. |
[in] | Name | Option name. |
[in] | StrValue | Option value if successful, not modified otherwise; note that NULL is returned if option exists with no value. Caller must not attempt to free this memory. |
TRUE | Option exists. |
FALSE | Option not found. |
Definition at line 717 of file BootArguments.c.
OC_PARSED_VAR * OcParsedVarsItemAt | ( | IN CONST OC_FLEX_ARRAY * | ParsedVars, |
IN CONST UINTN | Index ) |
Return parsed variable at given index.
[in] | ParsedVars | Parsed variables. |
[in] | Index | Index of option to return. |
Parsed | option. |
Definition at line 657 of file BootArguments.c.
EFI_STATUS OcParseLoadOptions | ( | IN CONST EFI_LOADED_IMAGE_PROTOCOL * | LoadedImage, |
OUT OC_FLEX_ARRAY ** | ParsedVars ) |
Parse loaded image protocol load options, resultant options are in the same format as is returned by OcParsedVars and may be examined using the same utility methods.
Assumes CHAR_NULL terminated Unicode string of space separated options, each of form {name} or {name}={value}. Double quotes can be used round {value} to include spaces, and '\' can be used within quoted or unquoted values to escape any character (including space and '"').
Note: Var names and values are left as pointers to within the original raw LoadOptions string, which may be modified during processing.
[in] | LoadedImage | Loaded image handle. |
[out] | ParsedVars | Parsed load options if successful, NULL otherwise. Caller may free after use with OcFlexArrayFree if required. |
EFI_SUCCESS | Success. |
EFI_NOT_FOUND | Missing or empty load options. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_INVALID_PARAMETER | Invalid load options detected. |
Definition at line 416 of file BootArguments.c.
EFI_STATUS OcParseVars | ( | IN VOID * | StrVars, |
OUT OC_FLEX_ARRAY ** | ParsedVars, | ||
IN CONST OC_STRING_FORMAT | StringFormat, | ||
IN CONST BOOLEAN | TokensOnly ) |
Parse Unix-style var file or string. Parses a couple of useful ASCII GRUB config files (multi-line, name=var, with optional comments) and defines a standard format for Unicode UEFI LoadOptions.
Assumes CHAR_NULL terminated Unicode string of space separated options, each of form {name} or {name}={value}. Double quotes can be used round {value} to include spaces, and backslash can be used within quoted or unquoted values to escape any character (including space and double quote). Comments (if any) run from hash symbol to end of same line.
Note: Var names and values are left as pointers to within the raw string, which may be modified during processing.
[in] | StrVars | Raw var string. |
[out] | ParsedVars | Parsed variables if successful, NULL otherwise. Caller may free after use with OcFlexArrayFree. |
[in] | StringFormat | Are option names and values Unicode or ASCII? |
[in] | TokensOnly | If TRUE parse as a sequence of token values only, rather than as a sequence of name[=[value]] pairs. |
EFI_SUCCESS | Success. |
EFI_NOT_FOUND | Missing or empty load options. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_INVALID_PARAMETER | Invalid load options detected. |
Definition at line 449 of file BootArguments.c.
EFI_STATUS EFIAPI OcPlayAudioBeep | ( | IN OC_PICKER_CONTEXT * | Context, |
IN UINT32 | ToneCount, | ||
IN UINT32 | ToneLength, | ||
IN UINT32 | SilenceLength ) |
Generate cycles of beep signals for context with silence afterwards, blocking.
[in] | Context | Picker context. |
[in] | ToneCount | Number of signals to produce. |
[in] | ToneLength | Signal length in milliseconds. |
[in] | SilenceLength | Silence length in milliseconds. |
EFI_SUCCESS | on success or when unnecessary. |
Definition at line 155 of file BootAudio.c.
EFI_STATUS EFIAPI OcPlayAudioEntry | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_BOOT_ENTRY * | Entry ) |
Play audio entry for context.
[in] | Context | Picker context. |
[in] | Entry | Entry to play. |
EFI_SUCCESS | on success or when unnecessary. |
Definition at line 188 of file BootAudio.c.
EFI_STATUS EFIAPI OcPlayAudioFile | ( | IN OC_PICKER_CONTEXT * | Context, |
IN CONST CHAR8 * | BasePath, | ||
IN CONST CHAR8 * | BaseType, | ||
IN BOOLEAN | Fallback ) |
Play audio file for context.
[in] | Context | Picker context. |
[in] | BasePath | File base path. |
[in] | BaseType | Audio base type. |
[in] | Fallback | Try to fallback to beeps on failure. |
EFI_SUCCESS | on success or when unnecessary. |
Definition at line 77 of file BootAudio.c.
EFI_STATUS EFIAPI OcPreLocateAudioProtocol | ( | IN OC_PICKER_CONTEXT * | Context | ) |
Pre-locate audio protocol for picker context, so that boot entry protocol methods can treat this as the definitive audio protocol instance.
[in] | Context | Picker context. |
EFI_SUCCESS | on success or when unnecessary. |
Definition at line 53 of file BootAudio.c.
VOID * OcReadApplePanicLog | ( | OUT UINT32 * | PanicSize | ) |
Read and expand Apple panic log if present.
[out] | PanicSize | Size of the panic log on success. |
panic | buffer on success. |
NULL | on failure. |
Definition at line 242 of file ApplePanic.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.
VOID OcRemoveArgumentFromCmd | ( | IN OUT CHAR8 * | CommandLine, |
IN CONST CHAR8 * | Argument ) |
Remove argument from command line if present.
[in,out] | CommandLine | Argument command line, e.g. for boot.efi. |
[in] | Argument | Argument, e.g. -v, slide=, debug=, etc. |
Definition at line 136 of file BootArguments.c.
EFI_STATUS EFIAPI OcResetSystem | ( | IN CHAR16 * | Mode | ) |
Reset the system. Fails to reset if firmware mode is requested but not supported. Defaults to cold reset when other reset fails, or unknown reset mode is requested.
[in] | Mode | Reset mode. Supported modes are:
|
EFI_SUCCESS | System was reset. |
other | System could not be reset. |
< Unreachable
Definition at line 55 of file OcResetSystem.c.
EFI_STATUS EFIAPI OcResetToFirmwareSettingsSupported | ( | VOID | ) |
Tests whether reset to firmware settings is supported.
EFI_SUCCESS | Reset to firmware settings is supported. |
other | Reset to firmware settings is not supported. |
Definition at line 22 of file OcResetSystem.c.
EFI_STATUS OcRunBootPicker | ( | IN OC_PICKER_CONTEXT * | Context | ) |
Install missing boot policy, scan, and show simple boot menu.
[in] | Context | Picker context. |
does | not return unless a fatal error happened. |
Definition at line 258 of file OcBootManagementLib.c.
EFI_STATUS OcRunFirmwareApplication | ( | IN EFI_GUID * | ApplicationGuid, |
IN BOOLEAN | SetReason ) |
Launch firmware application.
[in] | ApplicationGuid | Application GUID identifier in the firmware. |
[in] | SetReason | Pass enter reason (specific to Apple BootPicker). |
error | code, should not return. |
Definition at line 558 of file OcBootManagementLib.c.
OC_BOOT_CONTEXT * OcScanForBootEntries | ( | IN OC_PICKER_CONTEXT * | Context | ) |
Scan system for boot entries.
[in] | Context | Picker context. |
boot | context allocated from pool. |
< Index if Tools or Entries item is pre-created
< ID if boot entry protocol item is pre-created
< PARTUUID for pre-created boot entry protocol item
Definition at line 2102 of file BootEntryManagement.c.
OC_BOOT_CONTEXT * OcScanForDefaultBootEntry | ( | IN OC_PICKER_CONTEXT * | Context, |
IN BOOLEAN | UseBootNextOnly ) |
Scan system for first entry to boot. This is likely to return an incomplete list and can even give NULL, when only tools and system entries are present.
[in] | Context | Picker context. |
[in] | UseBootNextOnly | Use only BootNext. |
boot | context allocated from pool. |
Definition at line 2293 of file BootEntryManagement.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.
EFI_STATUS EFIAPI OcShowSimpleBootMenu | ( | IN OC_BOOT_CONTEXT * | BootContext, |
IN OC_BOOT_ENTRY ** | BootEntries, | ||
OUT OC_BOOT_ENTRY ** | ChosenBootEntry ) |
Show simple boot entry selection menu and return chosen entry.
[in] | BootContext | Boot context. |
[in] | BootEntries | Enumerated entries. |
[in] | ChosenBootEntry | Chosen boot entry from BootEntries on success. |
EFI_SUCCESS | Executed successfully and picked up an entry. |
EFI_ABORTED | When the user chose to by pressing Esc or 0. |
Definition at line 332 of file BuiltinPicker.c.
EFI_STATUS EFIAPI OcShowSimplePasswordRequest | ( | IN OC_PICKER_CONTEXT * | Context, |
IN OC_PRIVILEGE_LEVEL | Level ) |
Show simple password prompt and return verification status.
[in] | Context | Picker context. |
[in] | Level | The privilege level to request escalating to. |
EFI_SUCCESS | The privilege level has been escalated successfully. |
EFI_ABORTED | The privilege escalation has been aborted. |
other | The system must be considered compromised. |
Definition at line 887 of file BuiltinPicker.c.
VOID EFIAPI OcToggleVoiceOver | ( | IN OC_PICKER_CONTEXT * | Context, |
IN CONST CHAR8 *BasePath | OPTIONAL, | ||
IN CONST CHAR8 *BaseType | OPTIONAL ) |
Toggle VoiceOver support.
[in] | Context | Picker context. |
[in] | BasePath | File base path of file to play after enabling VoiceOver. |
[in] | BaseType | Audio base type of file to play after enabling VoiceOver. |
Definition at line 255 of file BootAudio.c.
EFI_STATUS OcUnlockAppleFirmwareUI | ( | VOID | ) |
Force Apple Firmware UI to always reconnect to current console GOP.
EFI_SUCCESS | Firmware UI ConnectGop method was successfully reset. |
other | Compatible firmware UI protocol for reset could not be found. |
Definition at line 687 of file OcBootManagementLib.c.
BOOLEAN EFIAPI OcValidLoadOptions | ( | IN UINT32 | LoadOptionsSize, |
IN CONST VOID * | LoadOptions ) |
Are load options apparently valid (Unicode string or cleanly non-present)?
[in] | LoadOptionsSize | Load options size. |
[in] | LoadOptions | Load options. |
TRUE | if valid. |
Definition at line 384 of file BootArguments.c.
BOOLEAN EFIAPI OcVerifyPassword | ( | IN CONST UINT8 * | Password, |
IN UINT32 | PasswordSize, | ||
IN CONST OC_PRIVILEGE_CONTEXT * | PrivilegeContext ) |
Verify password.
Shared context function to be used by all pickers rather than directly linked call to OcVerifyPasswordSha512, to pick up status of Avx acceleration as enabled within OpenCore.efi and to avoid unnecessary OcCryptoLib lib linking into external picker.
[in] | Password | Password. |
[in] | PasswordSize | Password size. |
[in] | PrivilegeContext | Privilege context. |
True | if password verified successfully. |
Definition at line 199 of file OcBootManagementLib.c.