Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: e314132feaac3f62a27f1a4ffaae8f5c1fba3140
      
https://github.com/tianocore/edk2/commit/e314132feaac3f62a27f1a4ffaae8f5c1fba3140
  Author: Jin, Eric <eric....@intel.com>
  Date:   2019-08-07 (Wed, 07 Aug 2019)

  Changed paths:
    M MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c

  Log Message:
  -----------
  MdeModulePkg/EsrtFmpDxe: Enhance ESRT to support multiple controllers

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

The patch is to merge multiple FMP instances into single ESRT entry
when they have the same GUID.

The policy to LastAttemptStatus/LastAttemptVersion of ESRT entry is:
If all the LastAttemptStatus are LAST_ATTEMPT_STATUS_SUCCESS, then
LastAttemptVersion should be the smallest of LastAttemptVersion. If
any of the LastAttemptStatus is not LAST_ATTEMPT_STATUS_SUCCESS,
then the LastAttemptVersion/LastAttemptStatus should be the values
of the first FMP instance whose LastAttemptStatus is not
LAST_ATTEMPT_STATUS_SUCCESS.

To detect possible duplicated GUID/HardwareInstance, a table of
GUID/HardwareInstance pairs from all the EFI_FIRMWARE_IMAGE_DESCRIPTORs
from all FMP instances is built. If a duplicate is found, then generate
a DEBUG_ERROR message, generate an ASSERT(), and ignore the duplicate
EFI_FIRMWARE_IMAGE_DESCRIPTOR.

Add an internal worker function called FmpGetFirmwareImageDescriptor()
that retrieves the list of EFI_FIRMWARE_IMAGE_DESCRIPTORs from a single
FMP instance and returns the descriptors in an allocated buffer. This
function is used to get the descriptors used to build the table of
unique GUID/HardwareInstance pairs.  It is then used again to generate
the ESRT Table from all the EFI_FIRMWARE_IMAGE_DESCRIPTORs from all the
FMP instances. 2 passes are performed so the total number of
descriptors is known. This allows the correct sized buffers to always
be allocated.

Cc: Sean Brogan <sean.bro...@microsoft.com>
Cc: Bret Barkelew <bret.barke...@microsoft.com>
Cc: Jian J Wang <jian.j.w...@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>
Signed-off-by: Eric Jin <eric....@intel.com>
Reviewed-by: Hao A Wu <hao.a...@intel.com>




_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to