mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
ArmVirtPkg/PrePi: Ensure timely execution of library constructors
PrePi has a bare metal entry point, and so it is in charge of calling the library constructors once the C runtime has been initialized sufficiently. However, we are now relying on a HOB to have been constructed by the time the MMU code runs, and so the constructors should be run before that. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
d0ff1cae3a
commit
6c8a08bd8a
@ -60,6 +60,9 @@ PrePiMain (
|
|||||||
//
|
//
|
||||||
InvalidateDataCacheRange ((VOID *)(UINTN)PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize));
|
InvalidateDataCacheRange ((VOID *)(UINTN)PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize));
|
||||||
|
|
||||||
|
// SEC phase needs to run library constructors by hand.
|
||||||
|
ProcessLibraryConstructorList ();
|
||||||
|
|
||||||
// Initialize MMU and Memory HOBs (Resource Descriptor HOBs)
|
// Initialize MMU and Memory HOBs (Resource Descriptor HOBs)
|
||||||
Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));
|
Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
@ -93,9 +96,6 @@ PrePiMain (
|
|||||||
// Now, the HOB List has been initialized, we can register performance information
|
// Now, the HOB List has been initialized, we can register performance information
|
||||||
PERF_START (NULL, "PEI", NULL, StartTimeStamp);
|
PERF_START (NULL, "PEI", NULL, StartTimeStamp);
|
||||||
|
|
||||||
// SEC phase needs to run library constructors by hand.
|
|
||||||
ProcessLibraryConstructorList ();
|
|
||||||
|
|
||||||
// Assume the FV that contains the SEC (our code) also contains a compressed FV.
|
// Assume the FV that contains the SEC (our code) also contains a compressed FV.
|
||||||
Status = DecompressFirstFv ();
|
Status = DecompressFirstFv ();
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user