https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ea570975cfdaa9d275143...
commit 4ea570975cfdaa9d275143dda29df1983db931f7 Author: Denis Malikov filedem@gmail.com AuthorDate: Sun Feb 4 22:59:21 2018 +0700 Commit: Thomas Faber thomas.faber@reactos.org CommitDate: Sun Aug 5 10:14:57 2018 +0200
[HAL] Add NT6-compatible version of HalpMapPhysicalMemory64 and HalpUnmapVirtualAddress --- hal/halx86/acpi/busemul.c | 5 +++++ hal/halx86/generic/memory.c | 29 +++++++++++++++++++++++++---- hal/halx86/include/halp.h | 16 ++++++++++++++++ hal/halx86/legacy/bussupp.c | 5 +++++ 4 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/hal/halx86/acpi/busemul.c b/hal/halx86/acpi/busemul.c index 17697a4d3b..87ff519994 100644 --- a/hal/halx86/acpi/busemul.c +++ b/hal/halx86/acpi/busemul.c @@ -26,8 +26,13 @@ HalpRegisterKdSupportFunctions(VOID)
/* Register memory functions */ #ifndef _MINIHAL_ +#if (NTDDI_VERSION >= NTDDI_VISTA) + KdMapPhysicalMemory64 = HalpMapPhysicalMemory64Vista; + KdUnmapVirtualAddress = HalpUnmapVirtualAddressVista; +#else KdMapPhysicalMemory64 = HalpMapPhysicalMemory64; KdUnmapVirtualAddress = HalpUnmapVirtualAddress; +#endif #endif
/* Register ACPI stub */ diff --git a/hal/halx86/generic/memory.c b/hal/halx86/generic/memory.c index 587503fca1..14b7f67a6b 100644 --- a/hal/halx86/generic/memory.c +++ b/hal/halx86/generic/memory.c @@ -139,6 +139,23 @@ PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, IN PFN_COUNT PageCount) +{ + return HalpMapPhysicalMemory64Vista(PhysicalAddress, PageCount, TRUE); +} + +VOID +NTAPI +HalpUnmapVirtualAddress(IN PVOID VirtualAddress, + IN PFN_COUNT PageCount) +{ + HalpUnmapVirtualAddressVista(VirtualAddress, PageCount, TRUE); +} + +PVOID +NTAPI +HalpMapPhysicalMemory64Vista(IN PHYSICAL_ADDRESS PhysicalAddress, + IN PFN_COUNT PageCount, + IN BOOLEAN FlushCurrentTLB) { PHARDWARE_PTE PointerPte; PFN_NUMBER UsedPages = 0; @@ -199,14 +216,17 @@ HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, }
/* Flush the TLB and return the address */ - HalpFlushTLB(); + if (FlushCurrentTLB) + HalpFlushTLB(); + return VirtualAddress; }
VOID NTAPI -HalpUnmapVirtualAddress(IN PVOID VirtualAddress, - IN PFN_COUNT PageCount) +HalpUnmapVirtualAddressVista(IN PVOID VirtualAddress, + IN PFN_COUNT PageCount, + IN BOOLEAN FlushCurrentTLB) { PHARDWARE_PTE PointerPte; ULONG i; @@ -226,7 +246,8 @@ HalpUnmapVirtualAddress(IN PVOID VirtualAddress, }
/* Flush the TLB */ - HalpFlushTLB(); + if (FlushCurrentTLB) + HalpFlushTLB();
/* Put the heap back */ if (HalpHeapStart > VirtualAddress) HalpHeapStart = VirtualAddress; diff --git a/hal/halx86/include/halp.h b/hal/halx86/include/halp.h index ed430910fd..a8e935ff9b 100644 --- a/hal/halx86/include/halp.h +++ b/hal/halx86/include/halp.h @@ -646,6 +646,22 @@ HalpAllocPhysicalMemory( IN BOOLEAN Aligned );
+PVOID +NTAPI +HalpMapPhysicalMemory64Vista( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN PFN_COUNT PageCount, + IN BOOLEAN FlushCurrentTLB +); + +VOID +NTAPI +HalpUnmapVirtualAddressVista( + IN PVOID VirtualAddress, + IN PFN_COUNT NumberPages, + IN BOOLEAN FlushCurrentTLB +); + PVOID NTAPI HalpMapPhysicalMemory64( diff --git a/hal/halx86/legacy/bussupp.c b/hal/halx86/legacy/bussupp.c index 595bdeff53..a37d875ede 100644 --- a/hal/halx86/legacy/bussupp.c +++ b/hal/halx86/legacy/bussupp.c @@ -1228,8 +1228,13 @@ HalpRegisterKdSupportFunctions(VOID)
/* Register memory functions */ #ifndef _MINIHAL_ +#if (NTDDI_VERSION >= NTDDI_VISTA) + KdMapPhysicalMemory64 = HalpMapPhysicalMemory64Vista; + KdUnmapVirtualAddress = HalpUnmapVirtualAddressVista; +#else KdMapPhysicalMemory64 = HalpMapPhysicalMemory64; KdUnmapVirtualAddress = HalpUnmapVirtualAddress; +#endif #endif
/* Register ACPI stub */