mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
- Don't use the stack in FASTCALL_PROLOG. It messes up NPX checks (this is a bug, it shouldn't happen... related to DPC stack bug.)
- Zero out the trap/npx frame for new user-mode threads. - Use KeI386FxsrPresent and not KEI386XMMIPresent when setting up the context for a new thread. svn path=/trunk/; revision=26141
This commit is contained in:
parent
71e781df12
commit
5037bca4df
3 changed files with 12 additions and 4 deletions
|
@ -700,8 +700,10 @@ Dr_&EndLabel:
|
|||
//
|
||||
.macro FASTCALL_PROLOG Label EndLabel
|
||||
/* Set FS to PCR */
|
||||
push KGDT_R0_PCR
|
||||
pop fs
|
||||
//push KGDT_R0_PCR
|
||||
//pop fs
|
||||
mov ecx, KGDT_R0_PCR
|
||||
mov fs, cx
|
||||
|
||||
/* Set user selector */
|
||||
mov ecx, KGDT_R3_DATA | RPL_MASK
|
||||
|
|
|
@ -364,11 +364,13 @@ GetSwapLock:
|
|||
jnz WmiTrace
|
||||
|
||||
AfterTrace:
|
||||
#ifdef CONFIG_SMP
|
||||
#ifdef DBG
|
||||
/* Assert that we're on the right CPU */
|
||||
mov cl, [esi+KTHREAD_NEXT_PROCESSOR]
|
||||
cmp cl, [ebx+KPCR_PROCESSOR_NUMBER]
|
||||
jnz WrongCpu
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Get CR0 and save it */
|
||||
|
|
|
@ -74,6 +74,10 @@ Ke386InitThreadWithContext(IN PKTHREAD Thread,
|
|||
Context = &LocalContext;
|
||||
ContextFlags = CONTEXT_CONTROL;
|
||||
|
||||
/* Zero out the trap frame and save area */
|
||||
RtlZeroMemory(&InitFrame->TrapFrame,
|
||||
KTRAP_FRAME_LENGTH + sizeof(FX_SAVE_AREA));
|
||||
|
||||
/* Setup the Fx Area */
|
||||
FxSaveArea = &InitFrame->FxSaveArea;
|
||||
|
||||
|
@ -114,7 +118,7 @@ Ke386InitThreadWithContext(IN PKTHREAD Thread,
|
|||
FxSaveArea->NpxSavedCpu = 0;
|
||||
|
||||
/* Now set the context flags depending on XMM support */
|
||||
ContextFlags |= (KeI386XMMIPresent) ? CONTEXT_EXTENDED_REGISTERS :
|
||||
ContextFlags |= (KeI386FxsrPresent) ? CONTEXT_EXTENDED_REGISTERS :
|
||||
CONTEXT_FLOATING_POINT;
|
||||
|
||||
/* Set the Thread's NPX State */
|
||||
|
@ -154,7 +158,7 @@ Ke386InitThreadWithContext(IN PKTHREAD Thread,
|
|||
TrapFrame->PreviousPreviousMode = UserMode;
|
||||
|
||||
/* Terminate the Exception Handler List */
|
||||
TrapFrame->ExceptionList = (PVOID)0xFFFFFFFF;
|
||||
TrapFrame->ExceptionList = EXCEPTION_CHAIN_END;
|
||||
|
||||
/* Setup the Stack for KiThreadStartup and Context Switching */
|
||||
StartFrame = &InitFrame->StartFrame;
|
||||
|
|
Loading…
Reference in a new issue