Files
edk2/DasharoModulePkg/Include/Library/DasharoVariablesLib.h
Sergii Dmytruk 96a094d553 MdeModulePkg/Universal/CapsuleRuntimeDxe: Reject capsules unless ME is HAP-disabled
HAP-disabled ME doesn't do anything, including writing to system flash,
which is what we need for a firmware update that relies on a warm reset.
coreboot assumes that HECI/soft-disabled state of ME isn't as good as
HMRFPO and switches to HMRFPO doing a global reset which loses in-RAM
capsules.

Checking variable's value should be enough, if somebody manually set it to
an invalid value, the update there will be a reboot without a capsule
update.  A more reliable solution would be to pass this information from
coreboot.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:31 +02:00

80 lines
1.6 KiB
C

/** @file
A library for providing services related to Dasharo-specific EFI variables.
Copyright (c) 2024, 3mdeb Sp. z o.o. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _DASHARO_VARIABLES_LIB_H_
#define _DASHARO_VARIABLES_LIB_H_
#include <Base.h>
#include <DasharoOptions.h>
/**
Query a default value for a specified variable.
@param VarName Name of the variable.
@retval Default value which is all zeroes for an unknown variable name.
**/
DASHARO_VAR_DATA
EFIAPI
DasharoGetVariableDefault (
CHAR16 *VarName
);
/**
Query attributes of a specified variable.
@param VarName Name of the variable.
@retval EFI variable attributes (the value is sensible for unknown ones).
**/
UINT32
EFIAPI
DasharoGetVariableAttributes (
CHAR16 *VarName
);
/**
Measure EFI variables specific to Dasharo.
This function should be called before booting into an OS or a UEFI
application.
@retval RETURN_SUCCESS Successfully measured all variables.
**/
EFI_STATUS
EFIAPI
DasharoMeasureVariables (
VOID
);
/**
Enable firmware update mode (FUM) for the duration of the next boot.
@retval RETURN_SUCCESS FUM was successfully enabled.
**/
EFI_STATUS
EFIAPI
DasharoEnableFUM (
VOID
);
/**
Check whether capsule updates which survive a warm system reset are permitted
by current configuration.
@retval TRUE Persistent capsules can be accepted by UpdateCapsule().
@retval FALSE UpdateCapsule() must fail with an error for such a capsule.
**/
BOOLEAN
EFIAPI
DasharoCapsulesCanPersistAcrossReset (
VOID
);
#endif