On amd64 the NextEntry member of MMPTE_LIST has 32 bits, but 36 would be required to cover the whole pte space. Therefore use MmSystemPtesStart[SystemPtePoolType] as base for the pfn linked list instead of MmSystemPteBase, which is set to PTE_BASE.

svn path=/branches/ros-amd64-bringup/; revision=44204
This commit is contained in:
Timo Kreuzer 2009-11-16 19:35:36 +00:00
parent a6656cbfae
commit bbc5790f22

View file

@ -64,7 +64,8 @@ MiReserveAlignedSystemPtes(IN ULONG NumberOfPtes,
// Now move to the first free system PTE cluster
//
PreviousPte = PointerPte;
PointerPte = MmSystemPteBase + PointerPte->u.List.NextEntry;
PointerPte = MmSystemPtesStart[SystemPtePoolType] +
PointerPte->u.List.NextEntry;
//
// Loop each cluster
@ -152,7 +153,8 @@ MiReserveAlignedSystemPtes(IN ULONG NumberOfPtes,
// Go to the next cluster
//
PreviousPte = PointerPte;
PointerPte = MmSystemPteBase + PointerPte->u.List.NextEntry;
PointerPte = MmSystemPtesStart[SystemPtePoolType] +
PointerPte->u.List.NextEntry;
ASSERT(PointerPte > PreviousPte);
}
@ -214,7 +216,7 @@ MiReleaseSystemPtes(IN PMMPTE StartingPte,
// Zero PTEs
//
RtlZeroMemory(StartingPte, NumberOfPtes * sizeof(MMPTE));
CurrentSize = (ULONG_PTR)(StartingPte - MmSystemPteBase);
CurrentSize = (ULONG_PTR)(StartingPte - MmSystemPtesStart[SystemPtePoolType]);
//
// Acquire the system PTE lock
@ -235,7 +237,8 @@ MiReleaseSystemPtes(IN PMMPTE StartingPte,
//
// Get the first real cluster of PTEs and check if it's ours
//
PointerPte = MmSystemPteBase + CurrentPte->u.List.NextEntry;
PointerPte = MmSystemPtesStart[SystemPtePoolType] +
CurrentPte->u.List.NextEntry;
if (CurrentSize < CurrentPte->u.List.NextEntry)
{
//
@ -395,7 +398,7 @@ MiInitializeSystemPtes(IN PMMPTE StartingPte,
StartingPte->u.List.NextEntry = ((ULONG)0xFFFFF);
MmFirstFreeSystemPte[PoolType].u.Long = 0;
MmFirstFreeSystemPte[PoolType].u.List.NextEntry = StartingPte -
MmSystemPteBase;
MmSystemPtesStart[PoolType];
//
// The second entry stores the size of this PTE space