OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcBootEntry.h File Reference
#include <Uefi.h>
#include <Library/OcBootManagementLib.h>
#include <Protocol/SimpleFileSystem.h>

Go to the source code of this file.

Data Structures

struct  OC_BOOT_ENTRY_PROTOCOL_
 

Macros

#define OC_BOOT_ENTRY_PROTOCOL_GUID
 
#define OC_BOOT_ENTRY_PROTOCOL_REVISION   6
 

Typedefs

typedef struct OC_BOOT_ENTRY_PROTOCOL_ OC_BOOT_ENTRY_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * OC_BOOT_ENTRY_PROTOCOL_GET_ENTRIES) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN CONST EFI_HANDLE Device OPTIONAL, OUT OC_PICKER_ENTRY **Entries, OUT UINTN *NumEntries)
 
typedef VOID(EFIAPI * OC_BOOT_ENTRY_PROTOCOL_FREE_ENTRIES) (IN OC_PICKER_ENTRY **Entries, IN UINTN NumEntries)
 
typedef CHAR8 *(EFIAPI * OC_BOOT_ENTRY_PROTOCOL_CHECK_HOTKEYS) (IN OUT OC_PICKER_CONTEXT *Context, IN UINTN NumKeys, IN APPLE_MODIFIER_MAP Modifiers, IN APPLE_KEY_CODE *Keys)
 
typedef BOOLEAN(EFIAPI * OC_CONSUME_ENTRY_PROTOCOL_ACTION) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN EFI_HANDLE BootEntryProtocolHandle, IN OC_BOOT_ENTRY_PROTOCOL *BootEntryProtocol, IN VOID *Context)
 

Functions

VOID OcConsumeBootEntryProtocol (IN OUT OC_PICKER_CONTEXT *PickerContext, IN EFI_HANDLE *EntryProtocolHandles, IN UINTN EntryProtocolHandleCount, IN OC_CONSUME_ENTRY_PROTOCOL_ACTION Action, IN VOID *Context)
 

Variables

EFI_GUID gOcBootEntryProtocolGuid
 

Detailed Description

OpenCore Boot Entry Protocol.

Copyright (C) 2021, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Definition in file OcBootEntry.h.

Macro Definition Documentation

◆ OC_BOOT_ENTRY_PROTOCOL_GUID

#define OC_BOOT_ENTRY_PROTOCOL_GUID
Value:
{ \
0x8604716E, 0xADD4, 0x45B4, { 0x84, 0x95, 0x08, 0xE3, 0x6D, 0x49, 0x7F, 0x4F } \
}

8604716E-ADD4-45B4-8495-08E36D497F4F

Definition at line 19 of file OcBootEntry.h.

◆ OC_BOOT_ENTRY_PROTOCOL_REVISION

#define OC_BOOT_ENTRY_PROTOCOL_REVISION   6

Currently supported OC_BOOT_ENTRY_PROTOCOL protocol revision. Needs to be changed every time the contract changes, including when passed-in structures OC_PICKER_CONTEXT and OC_PICKER_ENTRY change.

WARNING: This protocol is currently undergoing active design.

Definition at line 31 of file OcBootEntry.h.

Typedef Documentation

◆ OC_BOOT_ENTRY_PROTOCOL

Forward declaration of OC_BOOT_ENTRY_PROTOCOL structure.

Definition at line 36 of file OcBootEntry.h.

◆ OC_BOOT_ENTRY_PROTOCOL_CHECK_HOTKEYS

typedef CHAR8 *(EFIAPI * OC_BOOT_ENTRY_PROTOCOL_CHECK_HOTKEYS) (IN OUT OC_PICKER_CONTEXT *Context, IN UINTN NumKeys, IN APPLE_MODIFIER_MAP Modifiers, IN APPLE_KEY_CODE *Keys)

Detect hotkeys for boot entry protocol. If non-NULL is returned, it is the entry ID of the entry from this protocol which should be started immediately with no picker shown, similarly to a default boot entry. If protocol does not in fact return an entry with this ID, then picker with all auxiliary entries will be shown.

Parameters
[in]PickerContextPicker context.
[in]NumKeysNumber of keys held down. Recommended to check Keys and NumKeys using OcKeyMapHasKey.
[out]ModifiersKeyboard modifiers.
[out]KeysKeys held down. Recommended to check Keys and NumKeys using OcKeyMapHasKey.
Return values
IDof entry to start immediately, or NULL.

Definition at line 106 of file OcBootEntry.h.

◆ OC_BOOT_ENTRY_PROTOCOL_FREE_ENTRIES

typedef VOID(EFIAPI * OC_BOOT_ENTRY_PROTOCOL_FREE_ENTRIES) (IN OC_PICKER_ENTRY **Entries, IN UINTN NumEntries)

Free list of OpenCore boot entries from previous call to OC_BOOT_ENTRY_PROTOCOL_GET_ENTRIES.

Parameters
[in]EntriesList of boot entries, as returned by previous call. Correct implementation of interface should additionally zero this pointer before returning.
[in]NumEntriesThe number of entries, as returned by previous call.

Definition at line 83 of file OcBootEntry.h.

◆ OC_BOOT_ENTRY_PROTOCOL_GET_ENTRIES

typedef EFI_STATUS(EFIAPI * OC_BOOT_ENTRY_PROTOCOL_GET_ENTRIES) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN CONST EFI_HANDLE Device OPTIONAL, OUT OC_PICKER_ENTRY **Entries, OUT UINTN *NumEntries)

Return list of OpenCore boot entries associated with filesystem.

Parameters
[in]PickerContextPicker context.
[in]DeviceThe handle of the device to scan. NULL is passed in to request custom entries (e.g. system actions), non-NULL for entries found by scanning a given device. All implementations must support NULL and non-NULL values, but may immediately return EFI_NOT_FOUND if they do not provide entries of the corresponding type.
[out]BootEntriesList of boot entries associated with the filesystem. On EFI_SUCCESS BootEntries must be freed by the caller with FreePool after use, and each individual boot entry should eventually be freed by FreeBootEntry (as for boot entries created within OC itself). Does not point to allocated memory on return, if any status other than EFI_SUCCESS was returned.
[out]NumEntriesThe number of entries returned in the BootEntries list. If any status other than EFI_SUCCESS was returned, this value may not have been initialised and should be ignored by the caller.
Return values
EFI_SUCCESSAt least one matching entry was found, and the list and count of boot entries has been returned.
EFI_NOT_FOUNDNo matching boot entries were found.
EFI_OUT_OF_RESOURCESMemory allocation failure.
otherAn error returned by a sub-operation.

Definition at line 66 of file OcBootEntry.h.

◆ OC_CONSUME_ENTRY_PROTOCOL_ACTION

typedef BOOLEAN(EFIAPI * OC_CONSUME_ENTRY_PROTOCOL_ACTION) (IN OUT OC_PICKER_CONTEXT *PickerContext, IN EFI_HANDLE BootEntryProtocolHandle, IN OC_BOOT_ENTRY_PROTOCOL *BootEntryProtocol, IN VOID *Context)

Action to perform for each boot entry protocol instance during OcConsumeBootEntryProtocol.

Parameters
[in,out]PickerContextPicker context.
[in]BootEntryProtocolHandleBoot entry protocol handle.
[in]BootEntryProtocolBoot entry protocol.
[in]ContextAction context.
Return values
TRUE,proceedto next protocol instance.
FALSE,donot proceed to next protocol instance.

Definition at line 126 of file OcBootEntry.h.

Function Documentation

◆ OcConsumeBootEntryProtocol()

VOID OcConsumeBootEntryProtocol ( IN OUT OC_PICKER_CONTEXT * PickerContext,
IN EFI_HANDLE * EntryProtocolHandles,
IN UINTN EntryProtocolHandleCount,
IN OC_CONSUME_ENTRY_PROTOCOL_ACTION Action,
IN VOID * Context )

Consume boot entry protocol.

Parameters
[in,out]PickerContextPicker context.
[in]EntryProtocolHandlesBoot entry protocol handles, or NULL if none.
[in]EntryProtocolHandleCountCount of boot entry protocol handles.
[in]ActionAction to perform for each protocol instance.
[in]ContextContext.

Definition at line 187 of file BootEntryProtocol.c.

Variable Documentation

◆ gOcBootEntryProtocolGuid

EFI_GUID gOcBootEntryProtocolGuid
extern