mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
fixed DPC and APC calling code
svn path=/trunk/; revision=856
This commit is contained in:
parent
e0e40991af
commit
14ac854378
1 changed files with 21 additions and 14 deletions
|
@ -47,6 +47,8 @@ static unsigned int HiSetCurrentPICMask(unsigned int mask)
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern VOID KeApcProlog2();
|
||||||
|
|
||||||
static VOID HiSwitchIrql(KIRQL oldIrql)
|
static VOID HiSwitchIrql(KIRQL oldIrql)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Switches to the current irql
|
* FUNCTION: Switches to the current irql
|
||||||
|
@ -83,22 +85,27 @@ static VOID HiSwitchIrql(KIRQL oldIrql)
|
||||||
__asm__("sti\n\t");
|
__asm__("sti\n\t");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (CurrentIrql == APC_LEVEL)
|
|
||||||
{
|
|
||||||
HiSetCurrentPICMask(0);
|
HiSetCurrentPICMask(0);
|
||||||
__asm__("sti\n\t");
|
if(CurrentIrql == APC_LEVEL)
|
||||||
return;
|
{
|
||||||
}
|
if (DpcQueueSize > 0 )
|
||||||
|
{
|
||||||
|
KeSetCurrentIrql(DISPATCH_LEVEL);
|
||||||
|
__asm__("sti\n\t");
|
||||||
|
KeDrainDpcQueue();
|
||||||
|
__asm__("cli\n\t");
|
||||||
|
KeSetCurrentIrql(PASSIVE_LEVEL);
|
||||||
|
}
|
||||||
|
__asm__("sti\n\t");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( CurrentIrql == PASSIVE_LEVEL && CurrentThread->ApcState.KernelApcPending )
|
||||||
|
{
|
||||||
|
KeSetCurrentIrql( APC_LEVEL );
|
||||||
|
KeApcProlog2();
|
||||||
|
KeSetCurrentIrql( PASSIVE_LEVEL );
|
||||||
|
}
|
||||||
|
|
||||||
HiSetCurrentPICMask(0);
|
|
||||||
if (DpcQueueSize > 0 && oldIrql >= DISPATCH_LEVEL)
|
|
||||||
{
|
|
||||||
KeSetCurrentIrql(DISPATCH_LEVEL);
|
|
||||||
__asm__("sti\n\t");
|
|
||||||
KeDrainDpcQueue();
|
|
||||||
__asm__("cli\n\t");
|
|
||||||
KeSetCurrentIrql(PASSIVE_LEVEL);
|
|
||||||
}
|
|
||||||
__asm__("sti\n\t");
|
__asm__("sti\n\t");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue