From 5311c57b5fdb1a57d6017d9e89f8822a573fc6d1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 17 Dec 2017 17:37:43 +0100 Subject: [PATCH] [HAL] Use 64 bits for physical addresses. --- hal/halx86/generic/memory.c | 9 ++++----- hal/halx86/include/halp.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hal/halx86/generic/memory.c b/hal/halx86/generic/memory.c index e16eef3dbf8..587503fca1f 100644 --- a/hal/halx86/generic/memory.c +++ b/hal/halx86/generic/memory.c @@ -24,15 +24,15 @@ PVOID HalpHeapStart = MM_HAL_HEAP_START; /* PRIVATE FUNCTIONS *********************************************************/ -ULONG_PTR +ULONG64 NTAPI HalpAllocPhysicalMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN ULONG_PTR MaxAddress, + IN ULONG64 MaxAddress, IN PFN_NUMBER PageCount, IN BOOLEAN Aligned) { ULONG UsedDescriptors; - ULONG_PTR PhysicalAddress; + ULONG64 PhysicalAddress; PFN_NUMBER MaxPage, BasePage, Alignment; PLIST_ENTRY NextEntry; PMEMORY_ALLOCATION_DESCRIPTOR MdBlock, NewBlock, FreeBlock; @@ -71,9 +71,8 @@ HalpAllocPhysicalMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, (MdBlock->PageCount >= PageCount + Alignment) && (BasePage + PageCount + Alignment < MaxPage)) { - /* We found an address */ - PhysicalAddress = (BasePage + Alignment) << PAGE_SHIFT; + PhysicalAddress = ((ULONG64)BasePage + Alignment) << PAGE_SHIFT; break; } } diff --git a/hal/halx86/include/halp.h b/hal/halx86/include/halp.h index 8e79f3444ef..315282f8093 100644 --- a/hal/halx86/include/halp.h +++ b/hal/halx86/include/halp.h @@ -633,11 +633,11 @@ HalpReleasePciDeviceForDebugging( // // Memory routines // -ULONG_PTR +ULONG64 NTAPI HalpAllocPhysicalMemory( IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN ULONG_PTR MaxAddress, + IN ULONG64 MaxAddress, IN PFN_NUMBER PageCount, IN BOOLEAN Aligned );