[NTOSKRNL]

Converting MmLargeStackSize from registry setting to byte value is portable code, move it out of MiInitMachineDependent

svn path=/trunk/; revision=53819
This commit is contained in:
Timo Kreuzer 2011-09-23 22:24:11 +00:00
parent 551ca94879
commit 7ab32f0f5c
2 changed files with 22 additions and 22 deletions

View file

@ -163,28 +163,6 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
PMMPFN Pfn1;
ULONG Flags;
/* Check for kernel stack size that's too big */
if (MmLargeStackSize > (KERNEL_LARGE_STACK_SIZE / _1KB))
{
/* Sanitize to default value */
MmLargeStackSize = KERNEL_LARGE_STACK_SIZE;
}
else
{
/* Take the registry setting, and convert it into bytes */
MmLargeStackSize *= _1KB;
/* Now align it to a page boundary */
MmLargeStackSize = PAGE_ROUND_UP(MmLargeStackSize);
/* Sanity checks */
ASSERT(MmLargeStackSize <= KERNEL_LARGE_STACK_SIZE);
ASSERT((MmLargeStackSize & (PAGE_SIZE - 1)) == 0);
/* Make sure it's not too low */
if (MmLargeStackSize < KERNEL_STACK_SIZE) MmLargeStackSize = KERNEL_STACK_SIZE;
}
/* Check for global bit */
#if 0
if (KeFeatureBits & KF_GLOBAL_PAGE)

View file

@ -2038,6 +2038,28 @@ MmArmInitSystem(IN ULONG Phase,
MI_MIN_ALLOCATION_FRAGMENT);
}
/* Check for kernel stack size that's too big */
if (MmLargeStackSize > (KERNEL_LARGE_STACK_SIZE / _1KB))
{
/* Sanitize to default value */
MmLargeStackSize = KERNEL_LARGE_STACK_SIZE;
}
else
{
/* Take the registry setting, and convert it into bytes */
MmLargeStackSize *= _1KB;
/* Now align it to a page boundary */
MmLargeStackSize = PAGE_ROUND_UP(MmLargeStackSize);
/* Sanity checks */
ASSERT(MmLargeStackSize <= KERNEL_LARGE_STACK_SIZE);
ASSERT((MmLargeStackSize & (PAGE_SIZE - 1)) == 0);
/* Make sure it's not too low */
if (MmLargeStackSize < KERNEL_STACK_SIZE) MmLargeStackSize = KERNEL_STACK_SIZE;
}
/* Initialize the platform-specific parts */
MiInitMachineDependent(LoaderBlock);