summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Core/StandaloneMmCore.h
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2019-09-17 16:59:09 +0200
committerLaszlo Ersek <lersek@redhat.com>2019-10-09 09:40:10 +0200
commit7f72ec0b15fdc30899452279c988bf5dfb311951 (patch)
treed04882f3da40c33fcf60b28b827a1d425c485c1c /StandaloneMmPkg/Core/StandaloneMmCore.h
parent7eb6160d4fdff25ca623a4006e6f93e5e81038bf (diff)
downloadedk2-7f72ec0b15fdc30899452279c988bf5dfb311951.tar.gz
edk2-7f72ec0b15fdc30899452279c988bf5dfb311951.tar.bz2
edk2-7f72ec0b15fdc30899452279c988bf5dfb311951.zip
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>
Diffstat (limited to 'StandaloneMmPkg/Core/StandaloneMmCore.h')
-rw-r--r--StandaloneMmPkg/Core/StandaloneMmCore.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core/StandaloneMmCore.h
index 4d0eed273f..86f6cfa55a 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.h
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.h
@@ -67,7 +67,7 @@ typedef struct {
LIST_ENTRY ScheduledLink; // mScheduledQueue
- EFI_HANDLE FvHandle;
+ EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
EFI_GUID FileName;
VOID *Pe32Data;
UINTN Pe32DataSize;