OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
LegacyNvramSupport.c File Reference
#include <Uefi.h>
#include <Guid/OcVariable.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcConfigurationLib.h>
#include <Library/OcVariableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>

Go to the source code of this file.

Functions

EFI_STATUS OcProcessVariableGuid (IN CONST CHAR8 *AsciiVariableGuid, OUT GUID *VariableGuid, IN OC_NVRAM_LEGACY_MAP *Schema OPTIONAL, OUT OC_NVRAM_LEGACY_ENTRY **SchemaEntry OPTIONAL)
 
BOOLEAN OcVariableIsAllowedBySchemaEntry (IN OC_NVRAM_LEGACY_ENTRY *SchemaEntry, IN EFI_GUID *VariableGuid OPTIONAL, IN CONST VOID *VariableName, IN OC_STRING_FORMAT StringFormat)
 
VOID OcSetNvramVariable (IN CONST CHAR8 *AsciiVariableName, IN EFI_GUID *VariableGuid, IN UINT32 Attributes, IN UINT32 VariableSize, IN VOID *VariableData, IN OC_NVRAM_LEGACY_ENTRY *SchemaEntry OPTIONAL, IN BOOLEAN Overwrite)
 

Detailed Description

Supports legacy NVRAM configuration.

Used by OcMainLib and OcVariableRuntimeLib (i.e. emulated NVRAM support).

References OpenCore global config (for legacy NVRAM). Despite referencing global config directly, is required to live outside OcMainLib to avoid having to link OcMainLib and all its dependencies to OpenDuet, when we link OcVariableRuntimeLib to OpenDuet.

Copyright (c) 2019-2022, vit9696, mikebeaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Definition in file LegacyNvramSupport.c.

Function Documentation

◆ OcProcessVariableGuid()

EFI_STATUS OcProcessVariableGuid ( IN CONST CHAR8 * AsciiVariableGuid,
OUT GUID * VariableGuid,
IN OC_NVRAM_LEGACY_MAP *Schema OPTIONAL,
OUT OC_NVRAM_LEGACY_ENTRY **SchemaEntry OPTIONAL )

Test NVRAM GUID against legacy schema.

Parameters
[in]AsciiVariableGuidGuid to test in ASCII format.
[out]VariableGuidOn success AsciiVariableGuid converted to GUID format.
[in]SchemaSchema to test against.
[out]SchemaEntryOn success list of allowed variable names for this GUID.
Returns
EFI_SUCCESS If at least some variables are allowed under this GUID.

Definition at line 27 of file LegacyNvramSupport.c.

◆ OcSetNvramVariable()

VOID OcSetNvramVariable ( IN CONST CHAR8 * AsciiVariableName,
IN EFI_GUID * VariableGuid,
IN UINT32 Attributes,
IN UINT32 VariableSize,
IN VOID * VariableData,
IN OC_NVRAM_LEGACY_ENTRY *SchemaEntry OPTIONAL,
IN BOOLEAN Overwrite )

Set NVRAM variable - for internal use at NVRAM setup only.

Parameters
[in]AsciiVariableNameVariable name.
[in]VariableGuidVariably Guid.
[in]AttributesAttributes.
[in]VariableSizeData size.
[in]VariableDataData.
[in]SchemaEntryOptional schema to filter by.
[in]OverwriteIf TRUE pre-existing variables can be overwritten.

Definition at line 106 of file LegacyNvramSupport.c.

◆ OcVariableIsAllowedBySchemaEntry()

BOOLEAN OcVariableIsAllowedBySchemaEntry ( IN OC_NVRAM_LEGACY_ENTRY * SchemaEntry,
IN EFI_GUID *VariableGuid OPTIONAL,
IN CONST VOID * VariableName,
IN OC_STRING_FORMAT StringFormat )

Test NVRAM variable name against legacy schema.

Parameters
[in]SchemaEntryList of allowed names.
[in]VariableGuidVariable GUID (optional, for debug output only).
[in]VariableNameVariable name.
[in]StringFormatIs VariableName Ascii or Unicode?

Definition at line 58 of file LegacyNvramSupport.c.