mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 08:25:48 +00:00
- Implement (although non-optimally) MmGrowKernelStack for future use.
svn path=/trunk/; revision=20782
This commit is contained in:
parent
4051678e2f
commit
c39e10a566
1 changed files with 23 additions and 4 deletions
|
@ -166,7 +166,11 @@ MmCreateKernelStack(BOOLEAN GuiStack)
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark the Stack in use */
|
/*
|
||||||
|
* Mark the Stack in use.
|
||||||
|
* Note: Currently we mark all 60KB in use for a GUI Thread.
|
||||||
|
* We should only do this inside MmGrowKernelStack. TODO!
|
||||||
|
*/
|
||||||
for (i = 0; i < (StackSize / PAGE_SIZE); i++)
|
for (i = 0; i < (StackSize / PAGE_SIZE); i++)
|
||||||
{
|
{
|
||||||
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page[i]);
|
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page[i]);
|
||||||
|
@ -197,9 +201,24 @@ NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
MmGrowKernelStack(PVOID StackPointer)
|
MmGrowKernelStack(PVOID StackPointer)
|
||||||
{
|
{
|
||||||
DPRINT1("We don't support expansion yet :(\n");
|
PETHREAD Thread = PsGetCurrentThread();
|
||||||
KEBUGCHECK(0);
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
/* Make sure we have reserved space for our grow */
|
||||||
|
ASSERT(((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) <=
|
||||||
|
(KERNEL_LARGE_STACK_SIZE + PAGE_SIZE));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We'll give you three more pages.
|
||||||
|
* NOTE: See note in MmCreateKernelStack. These pages are already being reserved.
|
||||||
|
* It would be more efficient to only grow them (commit them) here.
|
||||||
|
*/
|
||||||
|
Thread->Tcb.StackLimit -= KERNEL_STACK_SIZE;
|
||||||
|
|
||||||
|
/* Return success */
|
||||||
|
DPRINT1("Thread, Thread Limit, Stack %p %p %p\n", KeGetCurrentThread(),
|
||||||
|
KeGetCurrentThread()->StackLimit,
|
||||||
|
StackPointer);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue