mirror of
https://github.com/reactos/reactos.git
synced 2024-09-11 05:12:43 +00:00
- Disable interrupts while in HalpLowerIrql
- Properly handle IRR. - Call IRR Handlers through the SWINT table. svn path=/trunk/; revision=23659
This commit is contained in:
parent
9f38dc5900
commit
955d04b6ff
|
@ -93,7 +93,8 @@ SoftIntByteTable:
|
|||
.byte DISPATCH_LEVEL /* IRR 6 */
|
||||
.byte DISPATCH_LEVEL /* IRR 7 */
|
||||
|
||||
SoftIntHandlerTable:
|
||||
.globl _SoftIntHandlerTable
|
||||
_SoftIntHandlerTable:
|
||||
.long _KiUnexpectedInterrupt /* PASSIVE_LEVEL */
|
||||
.long _HalpApcInterrupt /* APC_LEVEL */
|
||||
.long _HalpDispatchInterrupt /* DISPATCH_LEVEL */
|
||||
|
@ -179,7 +180,7 @@ _@HalRequestSoftwareInterrupt@4:
|
|||
|
||||
/* Call the pending interrupt */
|
||||
jmp $
|
||||
call SoftIntHandlerTable[edx*4]
|
||||
call _SoftIntHandlerTable[edx*4]
|
||||
|
||||
AfterCall:
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ UCHAR Table[8] =
|
|||
2, 2, 2, 2
|
||||
};
|
||||
|
||||
VOID HalpDispatchInterrupt(VOID);
|
||||
VOID HalpApcInterrupt(VOID);
|
||||
typedef VOID (*PSW_HANDLER)(VOID);
|
||||
extern PSW_HANDLER SoftIntHandlerTable[];
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
|
@ -34,6 +34,10 @@ VOID STATIC
|
|||
HalpLowerIrql(KIRQL NewIrql)
|
||||
{
|
||||
ULONG Mask;
|
||||
ULONG Flags;
|
||||
|
||||
Ki386SaveFlags(Flags);
|
||||
Ki386DisableInterrupts();
|
||||
|
||||
if (KeGetPcr()->Irql > DISPATCH_LEVEL)
|
||||
{
|
||||
|
@ -46,34 +50,21 @@ HalpLowerIrql(KIRQL NewIrql)
|
|||
if (NewIrql >= PROFILE_LEVEL)
|
||||
{
|
||||
KeGetPcr()->Irql = NewIrql;
|
||||
Ki386RestoreFlags(Flags);
|
||||
return;
|
||||
}
|
||||
if (NewIrql >= DISPATCH_LEVEL)
|
||||
{
|
||||
KeGetPcr()->Irql = NewIrql;
|
||||
Ki386RestoreFlags(Flags);
|
||||
return;
|
||||
}
|
||||
KeGetPcr()->Irql = DISPATCH_LEVEL;
|
||||
if (Table[KeGetPcr()->IRR] >= NewIrql)
|
||||
KeGetPcr()->Irql = NewIrql;
|
||||
if (Table[KeGetPcr()->IRR] > NewIrql)
|
||||
{
|
||||
if (Table[KeGetPcr()->IRR] == DISPATCH_LEVEL)
|
||||
{
|
||||
HalpDispatchInterrupt();
|
||||
SoftIntHandlerTable[Table[KeGetPcr()->IRR]]();
|
||||
}
|
||||
}
|
||||
KeGetPcr()->Irql = APC_LEVEL;
|
||||
if (NewIrql == APC_LEVEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Table[KeGetPcr()->IRR] >= NewIrql)
|
||||
{
|
||||
if (Table[KeGetPcr()->IRR] == APC_LEVEL)
|
||||
{
|
||||
HalpApcInterrupt();
|
||||
}
|
||||
}
|
||||
KeGetPcr()->Irql = PASSIVE_LEVEL;
|
||||
Ki386RestoreFlags(Flags);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
Loading…
Reference in a new issue