summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@arm.com>2020-06-09 10:34:27 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-06-16 16:15:00 +0000
commit493f2c69311806a214de2b3db7fdf7bc9162ea81 (patch)
tree8dc0786a8c26cca89a1180c08323a233b4eb50d2 /StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
parentcdc686223a2d9b8c64831ffbc4b68ca16245aae0 (diff)
downloadedk2-493f2c69311806a214de2b3db7fdf7bc9162ea81.tar.gz
edk2-493f2c69311806a214de2b3db7fdf7bc9162ea81.tar.bz2
edk2-493f2c69311806a214de2b3db7fdf7bc9162ea81.zip
StandaloneMmPkg/StandaloneMmCoreEntryPoint: relocate StMM core on the fly
Apply PE/COFF fixups when starting up the standalone MM core, so that it can execute at any address regardless of the link time address. Note that this requires the PE/COFF image to be emitted with its relocation section preserved. Special care is taken to ensure that TE images are dealt with correctly as well. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h')
-rw-r--r--StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
index 494bcf3dc2..0f9a032404 100644
--- a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
+++ b/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
@@ -71,6 +71,7 @@ typedef RETURN_STATUS (*REGION_PERMISSION_UPDATE_FUNC) (
and make further progress in the boot process.
@param ImageContext Pointer to PE/COFF image context
+ @param ImageBase Base of image in memory
@param SectionHeaderOffset Offset of PE/COFF image section header
@param NumberOfSections Number of Sections
@param TextUpdater Function to change code permissions
@@ -82,6 +83,7 @@ EFI_STATUS
EFIAPI
UpdateMmFoundationPeCoffPermissions (
IN CONST PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
+ IN EFI_PHYSICAL_ADDRESS ImageBase,
IN UINT32 SectionHeaderOffset,
IN CONST UINT16 NumberOfSections,
IN REGION_PERMISSION_UPDATE_FUNC TextUpdater,
@@ -98,6 +100,7 @@ UpdateMmFoundationPeCoffPermissions (
@param TeData Pointer to PE/COFF image data
@param ImageContext Pointer to PE/COFF image context
+ @param ImageBase Pointer to ImageBase variable
@param SectionHeaderOffset Offset of PE/COFF image section header
@param NumberOfSections Number of Sections
@@ -107,6 +110,7 @@ EFIAPI
GetStandaloneMmCorePeCoffSections (
IN VOID *TeData,
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
+ OUT EFI_PHYSICAL_ADDRESS *ImageBase,
IN OUT UINT32 *SectionHeaderOffset,
IN OUT UINT16 *NumberOfSections
);