audk/StandaloneMmPkg
Laszlo Ersek 7f72ec0b15 StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader tracking
The FvHasBeenProcessed() and FvIsBeingProcesssed() functions make sure
that every firmware volume is processed only once (every driver in every
firmware volume should be discovered only once). For this, the functions
use a linked list.

In MdeModulePkg's DXE Core and SMM Core, the key used for identifying
those firmware volumes that have been processed is the EFI_HANDLE on which
the DXE or SMM firmware volume protocol is installed. In the
StandaloneMmPkg core however, the key is the address of the firmware
volume header; that is, it has type (EFI_FIRMWARE_VOLUME_HEADER*).

(EFI_FIRMWARE_VOLUME_HEADER*) has nothing to do with EFI_HANDLE.
EFI_HANDLE just happens to be specified as (VOID*), and therefore the
conversion between (EFI_FIRMWARE_VOLUME_HEADER*) and EFI_HANDLE is silent.

(The FvHasBeenProcessed() and FvIsBeingProcesssed() functions were likely
copied verbatim from MdeModulePkg's DXE Core and/or the SMM Core, and not
flagged by the compiler in StandaloneMmPkg due to UEFI regrettably
specifying EFI_HANDLE as (VOID*), thereby enabling the above implicit
conversion.)

We should not exploit this circumstance. Represent the key type faithfully
instead.

This is a semantic fix; there is no change in operation.

Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
2019-10-09 09:40:10 +02:00
..
Core StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader tracking 2019-10-09 09:40:10 +02:00
Drivers/StandaloneMmCpu/AArch64 StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Include StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Library StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
StandaloneMmPkg.dec StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
StandaloneMmPkg.dsc StandaloneMmPkg: make package .DSC file build again 2019-09-17 09:52:24 +01:00