Author: sir_richard
Date: Wed Feb 10 05:12:23 2010
New Revision: 45549
URL:
http://svn.reactos.org/svn/reactos?rev=45549&view=rev
Log:
[NTOS]: Actually use calculated kernel stack size value.
[NTOS]: Define the template PTE/PDE statically, instead of doing it in code. It's
faster, and saves us the trouble of not being able to use the template from point 0. Move
the template setup into ARM3 instead of page.c.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
trunk/reactos/ntoskrnl/mm/i386/page.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Wed Feb 10 05:12:23 2010
@@ -29,6 +29,9 @@
PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor;
MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor;
+MMPTE ValidKernelPde = {.u.Hard.Valid = 1, .u.Hard.Write = 1, .u.Hard.Dirty = 1,
.u.Hard.Accessed = 1};
+MMPTE ValidKernelPte = {.u.Hard.Valid = 1, .u.Hard.Write = 1, .u.Hard.Dirty = 1,
.u.Hard.Accessed = 1};
+
/* PRIVATE FUNCTIONS **********************************************************/
PFN_NUMBER
@@ -70,7 +73,7 @@
ULONG FreePages = 0;
PFN_NUMBER PageFrameIndex, PoolPages;
PMMPTE StartPde, EndPde, PointerPte, LastPte;
- MMPTE TempPde = HyperTemplatePte, TempPte = HyperTemplatePte;
+ MMPTE TempPde, TempPte;
PVOID NonPagedPoolExpansionVa;
ULONG OldCount, L2Associativity;
PFN_NUMBER FreePage, FreePageCount, PagesLeft, BasePage, PageCount;
@@ -97,11 +100,18 @@
if (MmLargeStackSize < KERNEL_STACK_SIZE) MmLargeStackSize =
KERNEL_STACK_SIZE;
}
- //
- // The large kernel stack is cutomizable, but use default value for now
- //
- MmLargeStackSize = KERNEL_LARGE_STACK_SIZE;
-
+ /* Check for global bit */
+ if (KeFeatureBits & KF_GLOBAL_PAGE)
+ {
+ /* Set it on the template PTE and PDE */
+ ValidKernelPte.u.Hard.Global = TRUE;
+ ValidKernelPde.u.Hard.Global = TRUE;
+ }
+
+ /* Now templates are ready */
+ TempPte = ValidKernelPte;
+ TempPde = ValidKernelPde;
+
//
// Set CR3 for the system process
//
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Wed Feb 10 05:12:23 2010
@@ -1012,12 +1012,6 @@
DPRINT("MmInitGlobalKernelPageDirectory()\n");
- //
- // Setup template
- //
- HyperTemplatePte.u.Long = (PA_PRESENT | PA_READWRITE | PA_DIRTY | PA_ACCESSED);
- if (Ke386GlobalPagesEnabled) HyperTemplatePte.u.Long |= PA_GLOBAL;
-
for (i = ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i < 1024; i++)
{
if (i != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) &&