From 9b3c1a2a1d9e9093273e7c4723749c1083711749 Mon Sep 17 00:00:00 2001 From: David Welch Date: Thu, 22 Mar 2001 11:14:22 +0000 Subject: [PATCH] Make the trap handlers work early in the boot process svn path=/trunk/; revision=1727 --- reactos/ntoskrnl/ke/i386/kernel.c | 5 +++++ reactos/ntoskrnl/ke/i386/trap.s | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/i386/kernel.c b/reactos/ntoskrnl/ke/i386/kernel.c index 2dcc56fb5cd..6ed293d7324 100644 --- a/reactos/ntoskrnl/ke/i386/kernel.c +++ b/reactos/ntoskrnl/ke/i386/kernel.c @@ -36,6 +36,10 @@ #define NDEBUG #include +/* GLOBALS *******************************************************************/ + +ULONG KiPcrInitDone = 0; + /* FUNCTIONS *****************************************************************/ VOID @@ -72,6 +76,7 @@ KeInit2(VOID) PAGE_READWRITE, (ULONG)PcrPage); memset((PVOID)KPCR_BASE, 0, 4096); + KiPcrInitDone = 1; } diff --git a/reactos/ntoskrnl/ke/i386/trap.s b/reactos/ntoskrnl/ke/i386/trap.s index 7b0564c97e3..8a9b471f5b0 100644 --- a/reactos/ntoskrnl/ke/i386/trap.s +++ b/reactos/ntoskrnl/ke/i386/trap.s @@ -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: trap.s,v 1.7 2001/03/18 19:35:13 dwelch Exp $ +/* $Id: trap.s,v 1.8 2001/03/22 11:14:22 dwelch Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/i386/trap.s @@ -79,6 +79,13 @@ _KiTrapProlog: pushl %edi pushl %fs + /* + * Check that the PCR exits, very early in the boot process it may + * not + */ + cmpl $0, %ss:_KiPcrInitDone + je .L5 + /* Load the PCR selector into fs */ movl $PCR_SELECTOR, %ebx movl %ebx, %fs @@ -153,6 +160,10 @@ _KiTrapProlog: /* Return to the caller */ jmp _KiTrapEpilog + /* Handle the no-pcr case out of line */ +.L5: + pushl $0 + /* Handle the no-thread case out of line */ .L4: pushl $0