mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +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;
|
||||
}
|
||||
|
||||
extern VOID KeApcProlog2();
|
||||
|
||||
static VOID HiSwitchIrql(KIRQL oldIrql)
|
||||
/*
|
||||
* FUNCTION: Switches to the current irql
|
||||
|
@ -83,22 +85,27 @@ static VOID HiSwitchIrql(KIRQL oldIrql)
|
|||
__asm__("sti\n\t");
|
||||
return;
|
||||
}
|
||||
if (CurrentIrql == APC_LEVEL)
|
||||
{
|
||||
HiSetCurrentPICMask(0);
|
||||
__asm__("sti\n\t");
|
||||
return;
|
||||
}
|
||||
if(CurrentIrql == APC_LEVEL)
|
||||
{
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue