#define NDEBUG
#include <debug.h>
-#define GetPteAddress(x) (PHARDWARE_PTE)(((((ULONG_PTR)(x)) >> 12) << 2) + 0xC0000000)
-
/* PRIVATE FUNCTIONS *********************************************************/
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;