Author: ion
Date: Wed Aug 23 03:41:39 2006
New Revision: 23655
URL:
http://svn.reactos.org/svn/reactos?rev=23655&view=rev
Log:
- Use the IRR to determine APC delivery.
Modified:
trunk/reactos/hal/halx86/generic/irql.c
Modified: trunk/reactos/hal/halx86/generic/irql.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irql.c?…
==============================================================================
--- trunk/reactos/hal/halx86/generic/irql.c (original)
+++ trunk/reactos/hal/halx86/generic/irql.c Wed Aug 23 03:41:39 2006
@@ -60,6 +60,7 @@
Mask >>= 8;
WRITE_PORT_UCHAR((PUCHAR)0xa1, (UCHAR)Mask);
}
+
if (NewIrql >= PROFILE_LEVEL)
{
KeGetPcr()->Irql = NewIrql;
@@ -73,18 +74,24 @@
KeGetPcr()->Irql = DISPATCH_LEVEL;
if (Table[KeGetPcr()->IRR] >= NewIrql)
{
- KeGetPcr()->IRR &= ~4;
- KiDispatchInterrupt();
+ if (Table[KeGetPcr()->IRR] == DISPATCH_LEVEL)
+ {
+ KeGetPcr()->IRR &= ~4;
+ KiDispatchInterrupt();
+ }
}
KeGetPcr()->Irql = APC_LEVEL;
if (NewIrql == APC_LEVEL)
{
return;
}
- if (KeGetCurrentThread() != NULL &&
- KeGetCurrentThread()->ApcState.KernelApcPending)
+ if (Table[KeGetPcr()->IRR] >= NewIrql)
{
+ if (Table[KeGetPcr()->IRR] == APC_LEVEL)
+ {
+ KeGetPcr()->IRR &= ~2;
KiDeliverApc(KernelMode, NULL, NULL);
+ }
}
KeGetPcr()->Irql = PASSIVE_LEVEL;
}