- Remove some FPU deprecated constants and use the new ones.

- Deliver APCs on return from context switch with pending kernel APCs.

svn path=/trunk/; revision=23625
This commit is contained in:
Alex Ionescu 2006-08-20 20:27:03 +00:00
parent 893a8bcac6
commit 43d5f7e90d
3 changed files with 4 additions and 11 deletions

View file

@ -42,11 +42,6 @@
#define DR7_ACTIVE 0x00000055 /* If any of these bits are set, a Dr is active */
/* Possible values for KTHREAD's NpxState */
#define NPX_STATE_INVALID 0x01
#define NPX_STATE_VALID 0x02
#define NPX_STATE_DIRTY 0x04
#define FRAME_EDITED 0xFFF8
#ifndef __ASM__

View file

@ -330,10 +330,10 @@ KiGetFpuState(PKTHREAD Thread)
ULONG Cr0;
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
if (Thread->NpxState & NPX_STATE_VALID)
if (Thread->NpxState & NPX_STATE_LOADED)
{
FxSaveArea = (PFX_SAVE_AREA)((ULONG_PTR)Thread->InitialStack - sizeof (FX_SAVE_AREA));
if (Thread->NpxState & NPX_STATE_DIRTY)
if (Thread->NpxState & NPX_STATE_NOT_LOADED)
{
ASSERT(KeGetCurrentPrcb()->NpxThread == Thread);
@ -349,7 +349,7 @@ KiGetFpuState(PKTHREAD Thread)
KeGetCurrentPrcb()->NpxThread = NULL;
}
Ke386SetCr0(Cr0);
Thread->NpxState = NPX_STATE_VALID;
Thread->NpxState = NPX_STATE_LOADED;
}
}
KeLowerIrql(OldIrql);
@ -382,7 +382,7 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr)
CurrentThread = KeGetCurrentThread();
ASSERT(CurrentThread != NULL);
CurrentThread->NpxState |= NPX_STATE_DIRTY;
CurrentThread->NpxState |= NPX_STATE_NOT_LOADED;
KeLowerIrql(oldIrql);
DPRINT("Device not present exception handled!\n");

View file

@ -210,7 +210,6 @@ KiSwapThread(VOID)
DPRINT("Dispatching Thread as blocked\n");
ApcState = KiDispatchThreadNoLock(Waiting);
#if 0
/* Check if we need to deliver APCs */
if (ApcState)
{
@ -221,7 +220,6 @@ KiSwapThread(VOID)
KiDeliverApc(KernelMode, NULL, NULL);
ASSERT(CurrentThread->WaitIrql == 0);
}
#endif
/* Lower IRQL back to what it was */
KfLowerIrql(CurrentThread->WaitIrql);