mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/Esrt: Add ESRT_FW_TYPE_SYSTEMFIRMWARE check.
The previous ESRT driver unconditionally treat FMP to be ESRT_FW_TYPE_DEVICEFIRMWARE. EDKII System Capsule reuses FMP, but it is ESRT_FW_TYPE_SYSTEMFIRMWARE. Add check to ImageTypeId check to see if it is ESRT_FW_TYPE_SYSTEMFIRMWARE. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
d2a160304e
commit
ab3aac14ab
|
@ -4,7 +4,7 @@
|
|||
# This driver produces EsrtManagement protocol to manage cache ESRT repository for FMP/Non-FMP instances.
|
||||
# ESRT table based on repository is published on gEfiEventReadyToBootGuid.
|
||||
#
|
||||
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -64,6 +64,7 @@
|
|||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxFmpEsrtCacheNum ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxNonFmpEsrtCacheNum ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid ## CONSUMES
|
||||
|
||||
[Depex]
|
||||
gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Esrt management implementation.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -390,6 +390,35 @@ EXIT:
|
|||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Return if this FMP is a system FMP or a device FMP, based upon FmpImageInfo.
|
||||
|
||||
@param[in] FmpImageInfo A pointer to EFI_FIRMWARE_IMAGE_DESCRIPTOR
|
||||
|
||||
@return TRUE It is a system FMP.
|
||||
@return FALSE It is a device FMP.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsSystemFmp (
|
||||
IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfo
|
||||
)
|
||||
{
|
||||
GUID *Guid;
|
||||
UINTN Count;
|
||||
UINTN Index;
|
||||
|
||||
Guid = PcdGetPtr(PcdSystemFmpCapsuleImageTypeIdGuid);
|
||||
Count = PcdGetSize(PcdSystemFmpCapsuleImageTypeIdGuid)/sizeof(GUID);
|
||||
|
||||
for (Index = 0; Index < Count; Index++, Guid++) {
|
||||
if (CompareGuid(&FmpImageInfo->ImageTypeId, Guid)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Init one ESRT entry according to input FmpImageInfo (V1, V2, V3) .
|
||||
|
||||
|
@ -407,7 +436,11 @@ SetEsrtEntryFromFmpInfo (
|
|||
{
|
||||
EsrtEntry->FwVersion = FmpImageInfo->Version;
|
||||
EsrtEntry->FwClass = FmpImageInfo->ImageTypeId;
|
||||
if (IsSystemFmp(FmpImageInfo)) {
|
||||
EsrtEntry->FwType = ESRT_FW_TYPE_SYSTEMFIRMWARE;
|
||||
} else {
|
||||
EsrtEntry->FwType = ESRT_FW_TYPE_DEVICEFIRMWARE;
|
||||
}
|
||||
EsrtEntry->LowestSupportedFwVersion = 0;
|
||||
EsrtEntry->CapsuleFlags = 0;
|
||||
EsrtEntry->LastAttemptVersion = 0;
|
||||
|
|
Loading…
Reference in New Issue