mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:45:41 +00:00
[NTOSKRNL]
Fix a number of 64bit issues. svn path=/trunk/; revision=58050
This commit is contained in:
parent
df929fa5cf
commit
2f067ab47a
4 changed files with 21 additions and 4 deletions
|
@ -876,7 +876,8 @@ MiDispatchFault(IN BOOLEAN StoreInstruction,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PMMPTE SuperProtoPte;
|
PMMPTE SuperProtoPte;
|
||||||
PMMPFN Pfn1, OutPfn = NULL;
|
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",
|
DPRINT("ARM3 Page Fault Dispatcher for address: %p in process: %p\n",
|
||||||
Address,
|
Address,
|
||||||
Process);
|
Process);
|
||||||
|
@ -1055,7 +1056,7 @@ MiDispatchFault(IN BOOLEAN StoreInstruction,
|
||||||
if (ProcessedPtes)
|
if (ProcessedPtes)
|
||||||
{
|
{
|
||||||
/* Bump the transition count */
|
/* Bump the transition count */
|
||||||
InterlockedExchangeAdd(&KeGetCurrentPrcb()->MmTransitionCount, ProcessedPtes);
|
InterlockedExchangeAddSizeT(&KeGetCurrentPrcb()->MmTransitionCount, ProcessedPtes);
|
||||||
ProcessedPtes--;
|
ProcessedPtes--;
|
||||||
|
|
||||||
/* Loop all the processing we did */
|
/* Loop all the processing we did */
|
||||||
|
@ -1208,9 +1209,15 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
||||||
if (TrapInformation)
|
if (TrapInformation)
|
||||||
{
|
{
|
||||||
PKTRAP_FRAME TrapFrame = TrapInformation;
|
PKTRAP_FRAME TrapFrame = TrapInformation;
|
||||||
|
#ifdef _M_IX86
|
||||||
DbgPrint("MM:***EIP %p, EFL %p\n", TrapFrame->Eip, TrapFrame->EFlags);
|
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:***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);
|
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 */
|
/* Tell the trap handler to fail */
|
||||||
|
|
|
@ -1324,8 +1324,10 @@ MiInitializeSessionPool(VOID)
|
||||||
/* Initialize the first page table */
|
/* Initialize the first page table */
|
||||||
Index = (ULONG_PTR)MmSessionSpace->PagedPoolStart - (ULONG_PTR)MmSessionBase;
|
Index = (ULONG_PTR)MmSessionSpace->PagedPoolStart - (ULONG_PTR)MmSessionBase;
|
||||||
Index >>= 22;
|
Index >>= 22;
|
||||||
|
#ifndef _M_AMD64 // FIXME
|
||||||
ASSERT(MmSessionSpace->PageTables[Index].u.Long == 0);
|
ASSERT(MmSessionSpace->PageTables[Index].u.Long == 0);
|
||||||
MmSessionSpace->PageTables[Index] = *PointerPde;
|
MmSessionSpace->PageTables[Index] = *PointerPde;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Bump up counters */
|
/* Bump up counters */
|
||||||
InterlockedIncrementSizeT(&MmSessionSpace->NonPageablePages);
|
InterlockedIncrementSizeT(&MmSessionSpace->NonPageablePages);
|
||||||
|
|
|
@ -1580,7 +1580,9 @@ MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal)
|
||||||
DPRINT1("Last process in sessino %d going down!!!\n", SessionId);
|
DPRINT1("Last process in sessino %d going down!!!\n", SessionId);
|
||||||
|
|
||||||
/* Free the session page tables */
|
/* Free the session page tables */
|
||||||
|
#ifndef _M_AMD64
|
||||||
ExFreePool(SessionGlobal->PageTables);
|
ExFreePool(SessionGlobal->PageTables);
|
||||||
|
#endif
|
||||||
ASSERT(!MI_IS_PHYSICAL_ADDRESS(SessionGlobal));
|
ASSERT(!MI_IS_PHYSICAL_ADDRESS(SessionGlobal));
|
||||||
|
|
||||||
/* Capture the data page PFNs */
|
/* Capture the data page PFNs */
|
||||||
|
@ -1744,8 +1746,9 @@ MiSessionInitializeWorkingSetList(VOID)
|
||||||
|
|
||||||
/* Add this into the list */
|
/* Add this into the list */
|
||||||
Index = ((ULONG_PTR)WorkingSetList - (ULONG_PTR)MmSessionBase) >> 22;
|
Index = ((ULONG_PTR)WorkingSetList - (ULONG_PTR)MmSessionBase) >> 22;
|
||||||
|
#ifndef _M_AMD64
|
||||||
MmSessionSpace->PageTables[Index] = TempPte;
|
MmSessionSpace->PageTables[Index] = TempPte;
|
||||||
|
#endif
|
||||||
/* Initialize the page directory page, and now zero the working set list itself */
|
/* Initialize the page directory page, and now zero the working set list itself */
|
||||||
MiInitializePfnForOtherProcess(PageFrameIndex,
|
MiInitializePfnForOtherProcess(PageFrameIndex,
|
||||||
PointerPde,
|
PointerPde,
|
||||||
|
@ -1977,8 +1980,10 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
||||||
MmSessionSpace->Color = Color;
|
MmSessionSpace->Color = Color;
|
||||||
MmSessionSpace->NonPageablePages = MiSessionCreateCharge;
|
MmSessionSpace->NonPageablePages = MiSessionCreateCharge;
|
||||||
MmSessionSpace->CommittedPages = MiSessionCreateCharge;
|
MmSessionSpace->CommittedPages = MiSessionCreateCharge;
|
||||||
|
#ifndef _M_AMD64
|
||||||
MmSessionSpace->PageTables = PageTables;
|
MmSessionSpace->PageTables = PageTables;
|
||||||
MmSessionSpace->PageTables[PointerPde - MiAddressToPde(MmSessionBase)] = *PointerPde;
|
MmSessionSpace->PageTables[PointerPde - MiAddressToPde(MmSessionBase)] = *PointerPde;
|
||||||
|
#endif
|
||||||
InitializeListHead(&MmSessionSpace->ImageList);
|
InitializeListHead(&MmSessionSpace->ImageList);
|
||||||
DPRINT1("Session %d is ready to go: 0x%p 0x%p, %lx 0x%p\n",
|
DPRINT1("Session %d is ready to go: 0x%p 0x%p, %lx 0x%p\n",
|
||||||
*SessionId, MmSessionSpace, SessionGlobal, SessionPageDirIndex, PageTables);
|
*SessionId, MmSessionSpace, SessionGlobal, SessionPageDirIndex, PageTables);
|
||||||
|
|
|
@ -906,9 +906,10 @@ MiSessionCommitPageTables(IN PVOID StartVa,
|
||||||
Index = ((ULONG_PTR)StartVa - (ULONG_PTR)MmSessionBase) >> 22;
|
Index = ((ULONG_PTR)StartVa - (ULONG_PTR)MmSessionBase) >> 22;
|
||||||
while (StartPde <= EndPde)
|
while (StartPde <= EndPde)
|
||||||
{
|
{
|
||||||
|
#ifndef _M_AMD64
|
||||||
/* If we don't already have a page table for it, increment count */
|
/* If we don't already have a page table for it, increment count */
|
||||||
if (MmSessionSpace->PageTables[Index].u.Long == 0) PageCount++;
|
if (MmSessionSpace->PageTables[Index].u.Long == 0) PageCount++;
|
||||||
|
#endif
|
||||||
/* Move to the next one */
|
/* Move to the next one */
|
||||||
StartPde++;
|
StartPde++;
|
||||||
Index++;
|
Index++;
|
||||||
|
@ -924,6 +925,7 @@ MiSessionCommitPageTables(IN PVOID StartVa,
|
||||||
/* Loop each PDE while holding the working set lock */
|
/* Loop each PDE while holding the working set lock */
|
||||||
// MiLockWorkingSet(PsGetCurrentThread(),
|
// MiLockWorkingSet(PsGetCurrentThread(),
|
||||||
// &MmSessionSpace->GlobalVirtualAddress->Vm);
|
// &MmSessionSpace->GlobalVirtualAddress->Vm);
|
||||||
|
#ifndef _M_AMD64
|
||||||
while (StartPde <= EndPde)
|
while (StartPde <= EndPde)
|
||||||
{
|
{
|
||||||
/* Check if we already have a page table */
|
/* Check if we already have a page table */
|
||||||
|
@ -966,6 +968,7 @@ MiSessionCommitPageTables(IN PVOID StartVa,
|
||||||
StartPde++;
|
StartPde++;
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure we didn't do more pages than expected */
|
/* Make sure we didn't do more pages than expected */
|
||||||
ASSERT(ActualPages <= PageCount);
|
ASSERT(ActualPages <= PageCount);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue