summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Common/Dependency.h15
-rw-r--r--MdePkg/Include/Common/FirmwareFileSystem.h7
-rw-r--r--MdePkg/Include/Common/FirmwareVolumeHeader.h7
-rw-r--r--MdePkg/Library/BasePeCoffLib/BasePeCoff.c7
4 files changed, 15 insertions, 21 deletions
diff --git a/MdePkg/Include/Common/Dependency.h b/MdePkg/Include/Common/Dependency.h
index d82cefd958..b38dcd5477 100644
--- a/MdePkg/Include/Common/Dependency.h
+++ b/MdePkg/Include/Common/Dependency.h
@@ -12,6 +12,9 @@
Module Name: Dependency.h
+ @par Revision Reference:
+ These definitions are from DxeCis 0.91 spec.
+
**/
#ifndef __DEPENDENCY_H__
@@ -34,16 +37,4 @@
/// EFI_DEP_SOR - If present, this must be the first opcode
#define EFI_DEP_SOR 0x09
-///
-/// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression
-/// to save time. A EFI_DEP_PUSH is evauated one an
-/// replaced with EFI_DEP_REPLACE_TRUE
-///
-#define EFI_DEP_REPLACE_TRUE 0xff
-
-///
-/// Define the initial size of the dependency expression evaluation stack
-///
-#define DEPEX_STACK_SIZE_INCREMENT 0x1000
-
#endif
diff --git a/MdePkg/Include/Common/FirmwareFileSystem.h b/MdePkg/Include/Common/FirmwareFileSystem.h
index 5678a95524..00ce8faff1 100644
--- a/MdePkg/Include/Common/FirmwareFileSystem.h
+++ b/MdePkg/Include/Common/FirmwareFileSystem.h
@@ -60,13 +60,6 @@
EFI_FILE_HEADER_INVALID \
)
-#define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
- ( \
- (BOOLEAN) ( \
- (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
- ) \
- )
-
typedef UINT16 EFI_FFS_FILE_TAIL;
///
diff --git a/MdePkg/Include/Common/FirmwareVolumeHeader.h b/MdePkg/Include/Common/FirmwareVolumeHeader.h
index 038dce6f7f..c2bbddf3e9 100644
--- a/MdePkg/Include/Common/FirmwareVolumeHeader.h
+++ b/MdePkg/Include/Common/FirmwareVolumeHeader.h
@@ -70,6 +70,13 @@ typedef UINT32 EFI_FVB_ATTRIBUTES;
EFI_FVB_LOCK_CAP \
)
+#define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
+ ( \
+ (BOOLEAN) ( \
+ (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
+ ) \
+ )
+
#define EFI_FVB_STATUS (EFI_FVB_READ_STATUS | EFI_FVB_WRITE_STATUS | EFI_FVB_LOCK_STATUS)
///
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
index ad9c627727..f16ea90ffa 100644
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
@@ -299,7 +299,7 @@ PeCoffLoaderGetImageInfo (
ImageContext->ImageAddress = Hdr.Pe32Plus->OptionalHeader.ImageBase;
}
} else {
- ImageContext->ImageAddress = (PHYSICAL_ADDRESS)(Hdr.Te->ImageBase);
+ ImageContext->ImageAddress = (PHYSICAL_ADDRESS)(Hdr.Te->ImageBase + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize);
}
//
@@ -598,8 +598,11 @@ PeCoffLoaderRelocateImage (
//
if (ImageContext->DestinationAddress != 0) {
BaseAddress = ImageContext->DestinationAddress;
- } else {
+ } else if (!(ImageContext->IsTeImage)) {
BaseAddress = ImageContext->ImageAddress;
+ } else {
+ Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
+ BaseAddress = ImageContext->ImageAddress + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
}
if (!(ImageContext->IsTeImage)) {