From 866abb233817eb349fa5fe2b32283e990a8e5056 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Wed, 9 Oct 2024 15:03:13 -0700 Subject: [PATCH] MdeModulePkg: Replace right bit shift operator with RShiftU64 Instead of using bit shift operations, it is preferable to use BaseLib bit shift functions to prevent compilers from inserting intrinsics. Signed-off-by: Jeremy Compostella --- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index 65e3405e9c..562092df70 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -638,7 +638,7 @@ PeiAllocatePages ( // Verify that there is sufficient memory to satisfy the allocation. // RemainingMemory = (UINTN)(*FreeMemoryTop - *FreeMemoryBottom); - RemainingPages = RemainingMemory >> EFI_PAGE_SHIFT; + RemainingPages = (UINTN)(RShiftU64 (RemainingMemory, EFI_PAGE_SHIFT)); // // The number of remaining pages needs to be greater than or equal to that of // the request pages. In addition, there should be enough space left to hold a