OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcVariableRuntime.h File Reference
#include <Uefi.h>
#include <Library/OcConfigurationLib.h>
#include <Library/OcTemplateLib.h>

Go to the source code of this file.

Data Structures

struct  OC_VARIABLE_RUNTIME_PROTOCOL_
 

Macros

#define OC_VARIABLE_RUNTIME_PROTOCOL_REVISION   1
 
#define OC_VARIABLE_RUNTIME_PROTOCOL_GUID
 

Typedefs

typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_LOAD_NVRAM) (IN OC_STORAGE_CONTEXT *StorageContext, IN OC_NVRAM_LEGACY_MAP *LegacyMap, IN BOOLEAN LegacyOverwrite)
 
typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_SAVE_NVRAM) (VOID)
 
typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_RESET_NVRAM) (VOID)
 
typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_SWITCH_TO_FALLBACK) (VOID)
 
typedef struct OC_VARIABLE_RUNTIME_PROTOCOL_ OC_VARIABLE_RUNTIME_PROTOCOL
 

Variables

EFI_GUID gOcVariableRuntimeProtocolGuid
 

Detailed Description

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

Definition in file OcVariableRuntime.h.

Macro Definition Documentation

◆ OC_VARIABLE_RUNTIME_PROTOCOL_GUID

#define OC_VARIABLE_RUNTIME_PROTOCOL_GUID
Value:
{ 0x3DBA852A, 0x2645, 0x4184, \
{ 0x95, 0x71, 0xE6, 0x0C, 0x2B, 0xFD, 0x72, 0x4C } }

Definition at line 22 of file OcVariableRuntime.h.

◆ OC_VARIABLE_RUNTIME_PROTOCOL_REVISION

#define OC_VARIABLE_RUNTIME_PROTOCOL_REVISION   1

Variable runtime protocol version.

Definition at line 16 of file OcVariableRuntime.h.

Typedef Documentation

◆ OC_VARIABLE_RUNTIME_PROTOCOL

The structure exposed by OC_VARIABLE_RUNTIME_PROTOCOL.

◆ OC_VARIABLE_RUNTIME_PROTOCOL_LOAD_NVRAM

typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_LOAD_NVRAM) (IN OC_STORAGE_CONTEXT *StorageContext, IN OC_NVRAM_LEGACY_MAP *LegacyMap, IN BOOLEAN LegacyOverwrite)

Load NVRAM from storage, applying legacy filter and overwrite settings.

Parameters
[in]StorageContextOpenCore storage context. Saved for used by any subsequent SaveNvram call.
[in]LegacyMapOpenCore legacy NVRAM map, stating which variables are allowed to be read/written. Saved for used by any subsequent SaveNvram call.
[in]LegacyOverwriteOpenCore NVRAM LegacyOverwrite setting.
Return values
EFI_INVALID_PARAMETERStorageContext or NvramConfig is NULL.
EFI_ALREADY_STARTEDHas been called already.
EFI_NOT_FOUNDInvalid or missing NVRAM storage.
EFI_UNSUPPORTEDInvalid NVRAM storage contents.
EFI_SUCCESSOn success.

Definition at line 42 of file OcVariableRuntime.h.

◆ OC_VARIABLE_RUNTIME_PROTOCOL_RESET_NVRAM

typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_RESET_NVRAM) (VOID)

Reset NVRAM. Uses storage context saved by required, prior call to LoadNvram.

Return values
EFI_NOT_READYIf called before LoadNvram.
EFI_NOT_FOUNDInvalid or missing NVRAM storage.
otherOther error from child function.
EFI_SUCCESSOn success.

Definition at line 75 of file OcVariableRuntime.h.

◆ OC_VARIABLE_RUNTIME_PROTOCOL_SAVE_NVRAM

typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_SAVE_NVRAM) (VOID)

Save NVRAM to storage, applying legacy filter. Uses legacy map and storage context saved by required, prior call to LoadNvram.

Return values
EFI_NOT_READYIf called before LoadNvram.
EFI_NOT_FOUNDInvalid or missing NVRAM storage.
EFI_UNSUPPORTEDInvalid NVRAM storage contents.
EFI_OUT_OF_RESOURCESOut of memory.
otherOther error from child function.
EFI_SUCCESSOn success.

Definition at line 61 of file OcVariableRuntime.h.

◆ OC_VARIABLE_RUNTIME_PROTOCOL_SWITCH_TO_FALLBACK

typedef EFI_STATUS(EFIAPI * OC_VARIABLE_RUNTIME_PROTOCOL_SWITCH_TO_FALLBACK) (VOID)

Switch to fallback NVRAM. Uses storage context saved by required, prior call to LoadNvram. This works around the fact that we cannot save NVRAM changes during macOS installer reboots (which never start launch daemon). In existing implementation this works in combination with Launchd.command, which renames previous nvram.plist as nvram.fallback on each save of new file.

Return values
EFI_NOT_READYIf called before LoadNvram.
EFI_NOT_FOUNDInvalid or missing NVRAM storage.
EFI_ALREADY_STARTEDAlready at fallback NVRAM.
EFI_OUT_OF_RESOURCESOut of memory.
otherOther error from child function.
EFI_SUCCESSOn success.

Definition at line 95 of file OcVariableRuntime.h.

Variable Documentation

◆ gOcVariableRuntimeProtocolGuid

EFI_GUID gOcVariableRuntimeProtocolGuid
extern