From 132b7c834f5168ce89f98f0c4eda545324225a33 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Tue, 22 Aug 2006 22:45:45 +0000 Subject: [PATCH] - Add the code necessary in the C version of KeLowerIRql to properly mask the PIC, and enable #ifed code in ASM KeRaiseIrql to mask the PIC, since it now works. svn path=/trunk/; revision=23654 --- reactos/hal/halx86/generic/irq.S | 2 -- reactos/hal/halx86/generic/irql.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/hal/halx86/generic/irq.S b/reactos/hal/halx86/generic/irq.S index 57447520568..236f8814435 100644 --- a/reactos/hal/halx86/generic/irq.S +++ b/reactos/hal/halx86/generic/irq.S @@ -464,14 +464,12 @@ _@KfRaiseIrql@4: /* Set the new IRQL */ mov [fs:KPCR_IRQL], cl -#if 0 /* Mask the interrupts in the PIC */ mov eax, _KiI8259MaskTable[ecx*4] or eax, [fs:KPCR_IDR] out 0x21, al shr eax, 8 out 0xA1, al -#endif /* Restore interrupts and return old IRQL */ popf diff --git a/reactos/hal/halx86/generic/irql.c b/reactos/hal/halx86/generic/irql.c index 792ab65aa1f..3a9a93a6a2c 100644 --- a/reactos/hal/halx86/generic/irql.c +++ b/reactos/hal/halx86/generic/irql.c @@ -51,6 +51,15 @@ VOID HalpEndSystemInterrupt(KIRQL Irql) VOID STATIC HalpLowerIrql(KIRQL NewIrql) { + ULONG Mask; + + if (KeGetPcr()->Irql > DISPATCH_LEVEL) + { + Mask = KeGetPcr()->IDR | KiI8259MaskTable[NewIrql]; + WRITE_PORT_UCHAR((PUCHAR)0x21, (UCHAR)Mask); + Mask >>= 8; + WRITE_PORT_UCHAR((PUCHAR)0xa1, (UCHAR)Mask); + } if (NewIrql >= PROFILE_LEVEL) { KeGetPcr()->Irql = NewIrql; @@ -112,6 +121,7 @@ KfLowerIrql (KIRQL NewIrql) HalpLowerIrql(NewIrql); } + VOID STDCALL HalEndSystemInterrupt (KIRQL Irql, ULONG Unknown2) /* * FUNCTION: Finish a system interrupt and restore the specified irq level.