OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | ProtocolIsVariablePolicyEnabled (OUT BOOLEAN *State) |
VOID EFIAPI | RecordSecureBootPolicyVarData (VOID) |
BOOLEAN | AtRuntime (VOID) |
EFI_LOCK * | InitializeLock (IN OUT EFI_LOCK *Lock, IN EFI_TPL Priority) |
VOID | AcquireLockOnlyAtBootTime (IN EFI_LOCK *Lock) |
VOID | ReleaseLockOnlyAtBootTime (IN EFI_LOCK *Lock) |
EFI_STATUS | GetFtwProtocol (OUT VOID **FtwProtocol) |
EFI_STATUS | GetFvbByHandle (IN EFI_HANDLE FvBlockHandle, OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock) |
EFI_STATUS | GetFvbCountAndBuffer (OUT UINTN *NumberHandles, OUT EFI_HANDLE **Buffer) |
VOID EFIAPI | VariableClassAddressChangeEvent (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | OnReadyToBoot (EFI_EVENT Event, VOID *Context) |
VOID EFIAPI | OnEndOfDxe (EFI_EVENT Event, VOID *Context) |
VOID | VariableWriteServiceInitializeDxe (VOID) |
VOID EFIAPI | FtwNotificationEvent (IN EFI_EVENT Event, IN VOID *Context) |
STATIC EFI_STATUS EFIAPI | MapCreateEventEx (IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN CONST VOID *NotifyContext OPTIONAL, IN CONST EFI_GUID *EventGroup OPTIONAL, OUT EFI_EVENT *Event) |
STATIC VOID | SaveAcpiGlobalVariable (IN EFI_SYSTEM_TABLE *SystemTable) |
STATIC VOID | RestoreAcpiGlobalVariable (IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | VariableServiceInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
EFI_HANDLE | mHandle = NULL |
EFI_EVENT | mVirtualAddressChangeEvent = NULL |
VOID * | mFtwRegistration = NULL |
VOID *** | mVarCheckAddressPointer = NULL |
UINTN | mVarCheckAddressPointerCount = 0 |
EDKII_VARIABLE_LOCK_PROTOCOL | mVariableLock = { VariableLockRequestToLock } |
EDKII_VARIABLE_POLICY_PROTOCOL | mVariablePolicyProtocol |
EDKII_VAR_CHECK_PROTOCOL | mVarCheck |
STATIC EFI_GUID | mAcpiGlobalVariableGuid |
STATIC VOID * | mAcpiGlobalVariable = NULL |
STATIC UINT32 | mAcpiGlobalVariableAttributes |
Implement all four UEFI Runtime Variable services for the nonvolatile and volatile storage space and install variable architecture protocol.
Modified to work with UEFI1.1 for Apple firmware, and for immediate install.
Copyright (C) 2013, Red Hat, Inc. Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
Copyright (c) Microsoft Corporation.
Additional modifications Copyright (c) 2022 Mike Beaton SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file VariableDxe.c.
VOID AcquireLockOnlyAtBootTime | ( | IN EFI_LOCK * | Lock | ) |
Acquires lock only at boot time. Simply returns at runtime.
This is a temperary function that will be removed when EfiAcquireLock() in UefiLib can handle the call in UEFI Runtimer driver in RT phase. It calls EfiAcquireLock() at boot time, and simply returns at runtime.
Lock | A pointer to the lock to acquire. |
Definition at line 122 of file VariableDxe.c.
BOOLEAN AtRuntime | ( | VOID | ) |
Return TRUE if ExitBootServices () has been called.
TRUE | If ExitBootServices () has been called. |
Definition at line 77 of file VariableDxe.c.
VOID EFIAPI FtwNotificationEvent | ( | IN EFI_EVENT | Event, |
IN VOID * | Context ) |
Fault Tolerant Write protocol notification event handler.
Non-Volatile variable write may needs FTW protocol to reclaim when writting variable.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 428 of file VariableDxe.c.
EFI_STATUS GetFtwProtocol | ( | OUT VOID ** | FtwProtocol | ) |
Retrieve the Fault Tolerent Write protocol interface.
[out] | FtwProtocol | The interface of Ftw protocol |
EFI_SUCCESS | The FTW protocol instance was found and returned in FtwProtocol. |
EFI_NOT_FOUND | The FTW protocol instance was not found. |
EFI_INVALID_PARAMETER | SarProtocol is NULL. |
Definition at line 164 of file VariableDxe.c.
EFI_STATUS GetFvbByHandle | ( | IN EFI_HANDLE | FvBlockHandle, |
OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL ** | FvBlock ) |
Retrieve the FVB protocol interface by HANDLE.
[in] | FvBlockHandle | The handle of FVB protocol that provides services for reading, writing, and erasing the target block. |
[out] | FvBlock | The interface of FVB protocol |
EFI_SUCCESS | The interface information for the specified protocol was returned. |
EFI_UNSUPPORTED | The device does not support the FVB protocol. |
EFI_INVALID_PARAMETER | FvBlockHandle is not a valid EFI_HANDLE or FvBlock is NULL. |
Definition at line 194 of file VariableDxe.c.
EFI_STATUS GetFvbCountAndBuffer | ( | OUT UINTN * | NumberHandles, |
OUT EFI_HANDLE ** | Buffer ) |
Function returns an array of handles that support the FVB protocol in a buffer allocated from pool.
[out] | NumberHandles | The number of handles returned in Buffer. |
[out] | Buffer | A pointer to the buffer to return the requested array of handles that support FVB protocol. |
EFI_SUCCESS | The array of handles was returned in Buffer, and the number of handles in Buffer was returned in NumberHandles. |
EFI_NOT_FOUND | No FVB handle was found. |
EFI_OUT_OF_RESOURCES | There is not enough pool memory to store the matching results. |
EFI_INVALID_PARAMETER | NumberHandles is NULL or Buffer is NULL. |
Definition at line 225 of file VariableDxe.c.
EFI_LOCK * InitializeLock | ( | IN OUT EFI_LOCK * | Lock, |
IN EFI_TPL | Priority ) |
Initializes a basic mutual exclusion lock.
This function initializes a basic mutual exclusion lock to the released state and returns the lock. Each lock provides mutual exclusion access at its task priority level. Since there is no preemption or multiprocessor support in EFI, acquiring the lock only consists of raising to the locks TPL. If Lock is NULL, then ASSERT(). If Priority is not a valid TPL value, then ASSERT().
Lock | A pointer to the lock data structure to initialize. |
Priority | EFI TPL is associated with the lock. |
Definition at line 101 of file VariableDxe.c.
STATIC EFI_STATUS EFIAPI MapCreateEventEx | ( | IN UINT32 | Type, |
IN EFI_TPL | NotifyTpl, | ||
IN EFI_EVENT_NOTIFY NotifyFunction | OPTIONAL, | ||
IN CONST VOID *NotifyContext | OPTIONAL, | ||
IN CONST EFI_GUID *EventGroup | OPTIONAL, | ||
OUT EFI_EVENT * | Event ) |
Definition at line 534 of file VariableDxe.c.
VOID EFIAPI OnEndOfDxe | ( | EFI_EVENT | Event, |
VOID * | Context ) |
Notification function of EFI_END_OF_DXE_EVENT_GROUP_GUID event group.
This is a notification function registered on EFI_END_OF_DXE_EVENT_GROUP_GUID event group.
Event | Event whose notification function is being invoked. |
Context | Pointer to the notification function's context. |
Definition at line 357 of file VariableDxe.c.
VOID EFIAPI OnReadyToBoot | ( | EFI_EVENT | Event, |
VOID * | Context ) |
Notification function of EVT_GROUP_READY_TO_BOOT event group.
This is a notification function registered on EVT_GROUP_READY_TO_BOOT event group. When the Boot Manager is about to load and execute a boot option, it reclaims variable storage if free size is below the threshold.
Event | Event whose notification function is being invoked. |
Context | Pointer to the notification function's context. |
Definition at line 311 of file VariableDxe.c.
EFI_STATUS EFIAPI ProtocolIsVariablePolicyEnabled | ( | OUT BOOLEAN * | State | ) |
This API function returns whether or not the policy engine is currently being enforced.
[out] | State | Pointer to a return value for whether the policy enforcement is currently enabled. |
EFI_SUCCESS | |
Others | An error has prevented this command from completing. |
Definition at line 523 of file VariableDxe.c.
VOID EFIAPI RecordSecureBootPolicyVarData | ( | VOID | ) |
Some Secure Boot Policy Variable may update following other variable changes(SecureBoot follows PK change, etc). Record their initial State when variable write service is ready.
Definition at line 321 of file Measurement.c.
VOID ReleaseLockOnlyAtBootTime | ( | IN EFI_LOCK * | Lock | ) |
Releases lock only at boot time. Simply returns at runtime.
This is a temperary function which will be removed when EfiReleaseLock() in UefiLib can handle the call in UEFI Runtimer driver in RT phase. It calls EfiReleaseLock() at boot time and simply returns at runtime.
Lock | A pointer to the lock to release. |
Definition at line 144 of file VariableDxe.c.
STATIC VOID RestoreAcpiGlobalVariable | ( | IN EFI_SYSTEM_TABLE * | SystemTable | ) |
Definition at line 608 of file VariableDxe.c.
STATIC VOID SaveAcpiGlobalVariable | ( | IN EFI_SYSTEM_TABLE * | SystemTable | ) |
Definition at line 569 of file VariableDxe.c.
VOID EFIAPI VariableClassAddressChangeEvent | ( | IN EFI_EVENT | Event, |
IN VOID * | Context ) |
Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.
This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. It convers pointer to new virtual address.
Event | Event whose notification function is being invoked. |
Context | Pointer to the notification function's context. |
Definition at line 257 of file VariableDxe.c.
EFI_STATUS EFIAPI VariableServiceInitialize | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable ) |
Variable Driver main entry point. The Variable driver places the 4 EFI runtime services in the EFI System Table and installs arch protocols for variable read and write services being available. It also registers a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | Variable service successfully initialized. |
Definition at line 645 of file VariableDxe.c.
VOID VariableWriteServiceInitializeDxe | ( | VOID | ) |
Initializes variable write service for DXE.
Definition at line 386 of file VariableDxe.c.
STATIC VOID* mAcpiGlobalVariable = NULL |
Definition at line 54 of file VariableDxe.c.
STATIC UINT32 mAcpiGlobalVariableAttributes |
Definition at line 58 of file VariableDxe.c.
STATIC EFI_GUID mAcpiGlobalVariableGuid |
Definition at line 48 of file VariableDxe.c.
VOID* mFtwRegistration = NULL |
Definition at line 30 of file VariableDxe.c.
EFI_HANDLE mHandle = NULL |
Definition at line 28 of file VariableDxe.c.
EDKII_VAR_CHECK_PROTOCOL mVarCheck |
Definition at line 42 of file VariableDxe.c.
VOID*** mVarCheckAddressPointer = NULL |
Definition at line 31 of file VariableDxe.c.
UINTN mVarCheckAddressPointerCount = 0 |
Definition at line 32 of file VariableDxe.c.
EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock = { VariableLockRequestToLock } |
Definition at line 33 of file VariableDxe.c.
EDKII_VARIABLE_POLICY_PROTOCOL mVariablePolicyProtocol |
Definition at line 34 of file VariableDxe.c.
EFI_EVENT mVirtualAddressChangeEvent = NULL |
Definition at line 29 of file VariableDxe.c.