diff --git a/reactos/ntoskrnl/mm/ARM3/pagfault.c b/reactos/ntoskrnl/mm/ARM3/pagfault.c index aa45a70c97b..b99f77e04c9 100644 --- a/reactos/ntoskrnl/mm/ARM3/pagfault.c +++ b/reactos/ntoskrnl/mm/ARM3/pagfault.c @@ -876,7 +876,8 @@ MiDispatchFault(IN BOOLEAN StoreInstruction, NTSTATUS Status; PMMPTE SuperProtoPte; PMMPFN Pfn1, OutPfn = NULL; - PFN_NUMBER PageFrameIndex, PteCount, ProcessedPtes; + PFN_NUMBER PageFrameIndex; + PFN_COUNT PteCount, ProcessedPtes; DPRINT("ARM3 Page Fault Dispatcher for address: %p in process: %p\n", Address, Process); @@ -1055,7 +1056,7 @@ MiDispatchFault(IN BOOLEAN StoreInstruction, if (ProcessedPtes) { /* Bump the transition count */ - InterlockedExchangeAdd(&KeGetCurrentPrcb()->MmTransitionCount, ProcessedPtes); + InterlockedExchangeAddSizeT(&KeGetCurrentPrcb()->MmTransitionCount, ProcessedPtes); ProcessedPtes--; /* Loop all the processing we did */ @@ -1208,9 +1209,15 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction, if (TrapInformation) { PKTRAP_FRAME TrapFrame = TrapInformation; +#ifdef _M_IX86 DbgPrint("MM:***EIP %p, EFL %p\n", TrapFrame->Eip, TrapFrame->EFlags); DbgPrint("MM:***EAX %p, ECX %p EDX %p\n", TrapFrame->Eax, TrapFrame->Ecx, TrapFrame->Edx); DbgPrint("MM:***EBX %p, ESI %p EDI %p\n", TrapFrame->Ebx, TrapFrame->Esi, TrapFrame->Edi); +#elif defined(_M_AMD64) + DbgPrint("MM:***RIP %p, EFL %p\n", TrapFrame->Rip, TrapFrame->EFlags); + DbgPrint("MM:***RAX %p, RCX %p RDX %p\n", TrapFrame->Rax, TrapFrame->Rcx, TrapFrame->Rdx); + DbgPrint("MM:***RBX %p, RSI %p RDI %p\n", TrapFrame->Rbx, TrapFrame->Rsi, TrapFrame->Rdi); +#endif } /* Tell the trap handler to fail */ diff --git a/reactos/ntoskrnl/mm/ARM3/pool.c b/reactos/ntoskrnl/mm/ARM3/pool.c index f31f512ac45..728949d7515 100644 --- a/reactos/ntoskrnl/mm/ARM3/pool.c +++ b/reactos/ntoskrnl/mm/ARM3/pool.c @@ -1324,8 +1324,10 @@ MiInitializeSessionPool(VOID) /* Initialize the first page table */ Index = (ULONG_PTR)MmSessionSpace->PagedPoolStart - (ULONG_PTR)MmSessionBase; Index >>= 22; +#ifndef _M_AMD64 // FIXME ASSERT(MmSessionSpace->PageTables[Index].u.Long == 0); MmSessionSpace->PageTables[Index] = *PointerPde; +#endif /* Bump up counters */ InterlockedIncrementSizeT(&MmSessionSpace->NonPageablePages); diff --git a/reactos/ntoskrnl/mm/ARM3/procsup.c b/reactos/ntoskrnl/mm/ARM3/procsup.c index 27660f72180..7cfa0b3dd49 100644 --- a/reactos/ntoskrnl/mm/ARM3/procsup.c +++ b/reactos/ntoskrnl/mm/ARM3/procsup.c @@ -1580,7 +1580,9 @@ MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal) DPRINT1("Last process in sessino %d going down!!!\n", SessionId); /* Free the session page tables */ +#ifndef _M_AMD64 ExFreePool(SessionGlobal->PageTables); +#endif ASSERT(!MI_IS_PHYSICAL_ADDRESS(SessionGlobal)); /* Capture the data page PFNs */ @@ -1744,8 +1746,9 @@ MiSessionInitializeWorkingSetList(VOID) /* Add this into the list */ Index = ((ULONG_PTR)WorkingSetList - (ULONG_PTR)MmSessionBase) >> 22; +#ifndef _M_AMD64 MmSessionSpace->PageTables[Index] = TempPte; - +#endif /* Initialize the page directory page, and now zero the working set list itself */ MiInitializePfnForOtherProcess(PageFrameIndex, PointerPde, @@ -1977,8 +1980,10 @@ MiSessionCreateInternal(OUT PULONG SessionId) MmSessionSpace->Color = Color; MmSessionSpace->NonPageablePages = MiSessionCreateCharge; MmSessionSpace->CommittedPages = MiSessionCreateCharge; +#ifndef _M_AMD64 MmSessionSpace->PageTables = PageTables; MmSessionSpace->PageTables[PointerPde - MiAddressToPde(MmSessionBase)] = *PointerPde; +#endif InitializeListHead(&MmSessionSpace->ImageList); DPRINT1("Session %d is ready to go: 0x%p 0x%p, %lx 0x%p\n", *SessionId, MmSessionSpace, SessionGlobal, SessionPageDirIndex, PageTables); diff --git a/reactos/ntoskrnl/mm/ARM3/section.c b/reactos/ntoskrnl/mm/ARM3/section.c index 5c10f2c4ce0..b3c4674aa74 100644 --- a/reactos/ntoskrnl/mm/ARM3/section.c +++ b/reactos/ntoskrnl/mm/ARM3/section.c @@ -906,9 +906,10 @@ MiSessionCommitPageTables(IN PVOID StartVa, Index = ((ULONG_PTR)StartVa - (ULONG_PTR)MmSessionBase) >> 22; while (StartPde <= EndPde) { +#ifndef _M_AMD64 /* If we don't already have a page table for it, increment count */ if (MmSessionSpace->PageTables[Index].u.Long == 0) PageCount++; - +#endif /* Move to the next one */ StartPde++; Index++; @@ -924,6 +925,7 @@ MiSessionCommitPageTables(IN PVOID StartVa, /* Loop each PDE while holding the working set lock */ // MiLockWorkingSet(PsGetCurrentThread(), // &MmSessionSpace->GlobalVirtualAddress->Vm); +#ifndef _M_AMD64 while (StartPde <= EndPde) { /* Check if we already have a page table */ @@ -966,6 +968,7 @@ MiSessionCommitPageTables(IN PVOID StartVa, StartPde++; Index++; } +#endif /* Make sure we didn't do more pages than expected */ ASSERT(ActualPages <= PageCount);