[REACTOS] Fix 64 bit build (#465)
[reactos.git] / hal / halx86 / generic / reboot.c
index 068cc17..587b116 100644 (file)
@@ -13,8 +13,6 @@
 #define NDEBUG
 #include <debug.h>
 
-#define GetPteAddress(x) (PHARDWARE_PTE)(((((ULONG_PTR)(x)) >> 12) << 2) + 0xC0000000)
-
 /* PRIVATE FUNCTIONS *********************************************************/
 
 VOID
@@ -29,22 +27,13 @@ VOID
 NTAPI
 HalpReboot(VOID)
 {
+    PHYSICAL_ADDRESS PhysicalAddress;
     UCHAR Data;
     PVOID ZeroPageMapping;
-    PHARDWARE_PTE Pte;
-
-    /* Get a PTE in the HAL reserved region */
-    ZeroPageMapping = (PVOID)(0xFFC00000 + PAGE_SIZE);
-    Pte = GetPteAddress(ZeroPageMapping);
-
-    /* Make it valid and map it to the first physical page */
-    Pte->Valid = 1;
-    Pte->Write = 1;
-    Pte->Owner = 1;
-    Pte->PageFrameNumber = 0;
 
-    /* Flush the TLB by resetting CR3 */
-    __writecr3(__readcr3());
+    /* Map the first physical page */
+    PhysicalAddress.QuadPart = 0;
+    ZeroPageMapping = HalpMapPhysicalMemory64(PhysicalAddress, 1);
 
     /* Enable warm reboot */
     ((PUSHORT)ZeroPageMapping)[0x239] = 0x1234;