mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[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:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user