From 020f18ca0b641dab66f2cd585b42fc04c70bcd94 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Thu, 19 Aug 2004 21:51:06 +0000 Subject: [PATCH] - Set the pde's for the kernel stack at thread creation time and not at any task switch. svn path=/trunk/; revision=10604 --- reactos/ntoskrnl/ke/i386/tskswitch.S | 17 ----------------- reactos/ntoskrnl/ke/kthread.c | 4 +++- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/reactos/ntoskrnl/ke/i386/tskswitch.S b/reactos/ntoskrnl/ke/i386/tskswitch.S index 66a13ac47fa..aa4e61640b9 100644 --- a/reactos/ntoskrnl/ke/i386/tskswitch.S +++ b/reactos/ntoskrnl/ke/i386/tskswitch.S @@ -145,23 +145,6 @@ _Ki386ContextSwitch: movl KPROCESS_DIRECTORY_TABLE_BASE(%ebx), %eax movl %eax, %cr3 - /* - * Set up the PDE for the top of the new stack. - */ - movl $0, %ebx -.L2: movl %edi, %esi - shr $22, %esi - movl 0xF03C0000(,%esi, 4), %eax - cmpl $0, %eax - jne .L1 - movl _MmGlobalKernelPageDirectory(,%esi, 4), %eax - movl %eax, 0xF03C0000(,%esi, 4) -.L1: - addl $4096, %edi - incl %ebx - cmp $(MM_STACK_SIZE / 4096), %ebx - jl .L2 - /* * FIXME: Restore floating point state */ diff --git a/reactos/ntoskrnl/ke/kthread.c b/reactos/ntoskrnl/ke/kthread.c index 2c2a1566283..ba76399e039 100644 --- a/reactos/ntoskrnl/ke/kthread.c +++ b/reactos/ntoskrnl/ke/kthread.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: kthread.c,v 1.49 2004/08/15 16:39:05 chorns Exp $ +/* $Id: kthread.c,v 1.50 2004/08/19 21:51:06 hbirr Exp $ * * FILE: ntoskrnl/ke/kthread.c * PURPOSE: Microkernel thread support @@ -189,6 +189,8 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First) Thread->KernelStack = (PVOID)&init_stack_top; } + MmUpdatePageDir((PEPROCESS)Process, (PVOID)Thread->StackLimit, MM_STACK_SIZE); + /* * The Native API function will initialize the TEB field later */