Author: ion
Date: Wed Aug 23 05:07:14 2006
New Revision: 23659
URL:
http://svn.reactos.org/svn/reactos?rev=23659&view=rev
Log:
- Disable interrupts while in HalpLowerIrql
- Properly handle IRR.
- Call IRR Handlers through the SWINT table.
Modified:
trunk/reactos/hal/halx86/generic/irq.S
trunk/reactos/hal/halx86/generic/irql.c
Modified: trunk/reactos/hal/halx86/generic/irq.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irq.S?r…
==============================================================================
--- trunk/reactos/hal/halx86/generic/irq.S (original)
+++ trunk/reactos/hal/halx86/generic/irq.S Wed Aug 23 05:07:14 2006
@@ -93,7 +93,8 @@
.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 @@
/* Call the pending interrupt */
jmp $
- call SoftIntHandlerTable[edx*4]
+ call _SoftIntHandlerTable[edx*4]
AfterCall:
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 05:07:14 2006
@@ -23,8 +23,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 @@
HalpLowerIrql(KIRQL NewIrql)
{
ULONG Mask;
+ ULONG Flags;
+
+ Ki386SaveFlags(Flags);
+ Ki386DisableInterrupts();
if (KeGetPcr()->Irql > DISPATCH_LEVEL)
{
@@ -46,34 +50,21 @@
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);
}
/**********************************************************************