Author: tkreuzer Date: Sun Dec 30 11:54:40 2012 New Revision: 58050
URL: http://svn.reactos.org/svn/reactos?rev=58050&view=rev Log: [NTOSKRNL] Fix a number of 64bit issues.
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c trunk/reactos/ntoskrnl/mm/ARM3/pool.c trunk/reactos/ntoskrnl/mm/ARM3/procsup.c trunk/reactos/ntoskrnl/mm/ARM3/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Sun Dec 30 11:54:40 2012 @@ -876,7 +876,8 @@ 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 @@ 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 @@ 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 */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Sun Dec 30 11:54:40 2012 @@ -1324,8 +1324,10 @@ /* 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);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c?... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Sun Dec 30 11:54:40 2012 @@ -1580,7 +1580,9 @@ 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 @@
/* 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 @@ 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);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c?... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Sun Dec 30 11:54:40 2012 @@ -906,9 +906,10 @@ 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 @@ /* 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 @@ StartPde++; Index++; } +#endif
/* Make sure we didn't do more pages than expected */ ASSERT(ActualPages <= PageCount);