edk2/FmpDevicePkg/FmpDxe
Shubham Kumar dc52b0c75b FmpDevicePkg/FmpDxe: Reduce NV variable reads for FMP state
In PopulateDescriptor(), each FMP device previously called
GetFmpControllerState() multiple times through individual getter
functions (GetVersionFromVariable, GetLowestSupportedVersionFromVariable,
etc.), each performing a separate GetVariable() call to read the same
FmpControllerState NV variable.

Rename the getter functions to *FromFmpControllerState and simplify
them to pure field extractors that take a required FMP_CONTROLLER_STATE
pointer. Each getter extracts the field value if the state is non-NULL
and the field is valid, returning a default otherwise. No getter calls
GetFmpControllerState() internally.

PopulateDescriptor() now calls GetFmpControllerState() once and passes
the result to all getters, then frees it after the last use. This
eliminates redundant NV reads when the variable exists and avoids
repeated failed reads and error messages when the variable does not
exist.

Signed-off-by: Shubham Kumar <kumarshubha@microsoft.com>
2026-07-20 05:44:52 +00:00
..
DetectTestKey.c FmpDevicePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FmpDxe.c FmpDevicePkg/FmpDxe: Reduce NV variable reads for FMP state 2026-07-20 05:44:52 +00:00
FmpDxe.h FmpDevicePkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
FmpDxe.inf FmpDevicePkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
FmpDxe.uni FmpDevicePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:00 -07:00
FmpDxeExtra.uni FmpDevicePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:00 -07:00
FmpDxeLib.inf FmpDevicePkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
VariableSupport.c FmpDevicePkg/FmpDxe: Reduce NV variable reads for FMP state 2026-07-20 05:44:52 +00:00
VariableSupport.h FmpDevicePkg/FmpDxe: Reduce NV variable reads for FMP state 2026-07-20 05:44:52 +00:00