[NTOS:KE/X64] Fix KiInterruptDispatch

- Enable interrupts
- Acquire the spinlock on SMP builds
This commit is contained in:
Timo Kreuzer 2024-12-05 15:37:28 +02:00
parent 29721ac552
commit 67231bd69a

View file

@ -23,8 +23,9 @@ EXTERN KiDpcInterruptHandler:PROC
EXTERN PsConvertToGuiThread:PROC EXTERN PsConvertToGuiThread:PROC
EXTERN MmCreateKernelStack:PROC EXTERN MmCreateKernelStack:PROC
EXTERN MmDeleteKernelStack:PROC EXTERN MmDeleteKernelStack:PROC
EXTERN KdSetOwedBreakpoints:PROC EXTERN KdSetOwedBreakpoints:PROC
EXTERN KeAcquireSpinLockAtDpcLevel:PROC
EXTERN KeReleaseSpinLockFromDpcLevel:PROC
/* Helper Macros *************************************************************/ /* Helper Macros *************************************************************/
@ -744,11 +745,13 @@ FUNC KiInterruptDispatch
movzx rax, byte ptr [rbx + KINTERRUPT_SynchronizeIrql] movzx rax, byte ptr [rbx + KINTERRUPT_SynchronizeIrql]
mov cr8, rax mov cr8, rax
/* Enable interrupts */
sti
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Acquire interrupt lock */ /* Acquire interrupt lock */
mov r8, [rbx + KINTERRUPT_ActualLock] mov rcx, [rbx + KINTERRUPT_ActualLock]
call KeAcquireSpinLockAtDpcLevel
//KxAcquireSpinLock(Interrupt->ActualLock);
#endif #endif
/* Call the ISR */ /* Call the ISR */
@ -758,10 +761,12 @@ FUNC KiInterruptDispatch
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Release interrupt lock */ /* Release interrupt lock */
//KxReleaseSpinLock(Interrupt->ActualLock); mov rcx, [rbx + KINTERRUPT_ActualLock]
call KeReleaseSpinLockFromDpcLevel
#endif #endif
/* Go back to old irql */ /* Disable interrupts and go back to old irql */
cli
movzx rax, byte ptr [rbp + KTRAP_FRAME_PreviousIrql] movzx rax, byte ptr [rbp + KTRAP_FRAME_PreviousIrql]
mov cr8, rax mov cr8, rax