mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2026-02-01 15:59:39 +00:00
OcAppleBootCompatLib: Update memory attributes before StartImage as well
This commit is contained in:
parent
ffb49563cd
commit
bb8bd5dedb
@ -447,6 +447,8 @@ OcStartImage (
|
||||
BOOT_COMPAT_CONTEXT *BootCompat;
|
||||
OC_FWRT_CONFIG Config;
|
||||
UINTN DataSize;
|
||||
EFI_PHYSICAL_ADDRESS Address;
|
||||
UINTN Pages;
|
||||
|
||||
BootCompat = GetBootCompatContext ();
|
||||
AppleLoadedImage = OcGetAppleBootLoadedImage (ImageHandle);
|
||||
@ -462,6 +464,14 @@ OcStartImage (
|
||||
gBS->CalculateCrc32 (gBS, gBS->Hdr.HeaderSize, &gBS->Hdr.CRC32);
|
||||
}
|
||||
|
||||
if (BootCompat->Settings.SyncRuntimePermissions && BootCompat->ServiceState.FwRuntime != NULL) {
|
||||
Status = BootCompat->ServiceState.FwRuntime->GetExecArea (&Address, &Pages);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
OcUpdateAttributes (Address, EfiRuntimeServicesCode, EFI_MEMORY_RO, EFI_MEMORY_XP);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Clear monitoring vars
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user