From 4879e13097830f9c7cb924a674bcf96cb7686baf Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Wed, 1 Mar 2017 12:03:26 +0800 Subject: [PATCH] MdeModulePkg: use LShiftU64() instead of "<<" to avoid IA32 build error. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Feng Tian Reviewed-by: Star Zeng --- MdeModulePkg/Core/Dxe/Mem/Page.c | 2 +- MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index d596db7ad4..7e8fa94d7d 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -554,7 +554,7 @@ CoreAddMemoryDescriptor ( CoreReleaseMemoryLock (); ApplyMemoryProtectionPolicy (EfiMaxMemoryType, Type, Start, - EFI_PAGES_TO_SIZE (NumberOfPages)); + LShiftU64 (NumberOfPages, EFI_PAGE_SHIFT)); // // If Loading Module At Fixed Address feature is enabled. try to allocate memory with Runtime code & Boot time code type diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c index 172d667985..45f360cccf 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -851,7 +851,7 @@ InitializeDxeNxMemoryProtectionPolicy ( if (Attributes != 0) { SetUefiImageMemoryAttributes ( MemoryMapEntry->PhysicalStart, - EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages), + LShiftU64 (MemoryMapEntry->NumberOfPages, EFI_PAGE_SHIFT), Attributes); } MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); -- 2.39.2