X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FMem%2FHeapGuard.c;fp=MdeModulePkg%2FCore%2FDxe%2FMem%2FHeapGuard.c;h=521e0d7b2a77831a206a458b89eaad2426acf550;hp=449a02265834b438f51de21939a370303a05010b;hb=e5001ab7a9c17fe1cf9155392c943a9c985c8a96;hpb=979b7d802c316722da3f3dee90799728c7aab38f diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c index 449a022658..521e0d7b2a 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -463,7 +463,7 @@ IsGuardPage ( IN EFI_PHYSICAL_ADDRESS Address ) { - UINTN BitMap; + UINT64 BitMap; // // There must be at least one guarded page before and/or after given @@ -1368,7 +1368,7 @@ GuardAllFreedPages ( UINT64 Address; UINT64 GuardPage; INTN Level; - UINTN BitIndex; + UINT64 BitIndex; UINTN GuardPageNumber; if (mGuardedMemoryMap == 0 || @@ -1475,12 +1475,12 @@ MergeGuardPages ( } Bitmap = 0; - Pages = EFI_SIZE_TO_PAGES (MaxAddress - MemoryMapEntry->PhysicalStart); - Pages -= MemoryMapEntry->NumberOfPages; + Pages = EFI_SIZE_TO_PAGES ((UINTN)(MaxAddress - MemoryMapEntry->PhysicalStart)); + Pages -= (INTN)MemoryMapEntry->NumberOfPages; while (Pages > 0) { if (Bitmap == 0) { EndAddress = MemoryMapEntry->PhysicalStart + - EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages); + EFI_PAGES_TO_SIZE ((UINTN)MemoryMapEntry->NumberOfPages); Bitmap = GetGuardedMemoryBits (EndAddress, GUARDED_HEAP_MAP_ENTRY_BITS); }