[NTOSKRNL]

◙ Fix MiInitializePageTable
◙ Comment out some more code for amd64

svn path=/trunk/; revision=48291
This commit is contained in:
Timo Kreuzer 2010-07-26 23:09:17 +00:00
parent 7d17455cc4
commit ac342cea5f
3 changed files with 12 additions and 8 deletions

View file

@ -1593,11 +1593,12 @@ MiBuildPagedPool(VOID)
#else
/* Do it this way */
// Bla = MmSystemPageDirectory[(PointerPde - (PMMPTE)PDE_BASE) / PDE_COUNT]
#endif
/* Initialize the PFN entry for it */
MiInitializePfnForOtherProcess(PageFrameIndex,
PointerPde,
MmSystemPageDirectory[(PointerPde - (PMMPTE)PDE_BASE) / PDE_COUNT]);
#endif
//
// Release the PFN database lock

View file

@ -99,10 +99,11 @@ MiCheckPdeForPagedPool(IN PVOID Address)
//
if (PointerPde->u.Hard.Valid == 0)
{
#ifndef _M_AMD64
#ifdef _M_AMD64
ASSERT(FALSE);
#else
/* This seems to be making the assumption that one PDE is one page long */
C_ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT)));
#endif
//
// Copy it from our double-mapped system page directory
@ -111,6 +112,7 @@ MiCheckPdeForPagedPool(IN PVOID Address)
MmSystemPagePtes[((ULONG_PTR)PointerPde &
(PAGE_SIZE - 1)) /
sizeof(MMPTE)].u.Long);
#endif
}
//

View file

@ -373,19 +373,20 @@ MiInitializeSessionSpace(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
VOID
MiInitializePageTable()
{
ULONG64 PageFrameOffset;
ULONG64 PxePhysicalAddress;
MMPTE TmplPte, *Pte;
PFN_NUMBER PxePfn;
/* HACK: don't use freeldr debug print anymore */
//FrLdrDbgPrint = NoDbgPrint;
/* Get current directory base */
MmSystemPageDirectory[0] = ((PMMPTE)PXE_SELFMAP)->u.Hard.PageFrameNumber;
PageFrameOffset = MmSystemPageDirectory[0] << PAGE_SHIFT;
ASSERT(PageFrameOffset == __readcr3());
PxePfn = ((PMMPTE)PXE_SELFMAP)->u.Hard.PageFrameNumber;
PxePhysicalAddress = PxePfn << PAGE_SHIFT;
ASSERT(PxePhysicalAddress == __readcr3());
/* Set directory base for the system process */
PsGetCurrentProcess()->Pcb.DirectoryTableBase[0] = PageFrameOffset;
PsGetCurrentProcess()->Pcb.DirectoryTableBase[0] = PxePhysicalAddress;
/* Enable global pages */
__writecr4(__readcr4() | CR4_PGE);