From b60e24ccb5fc5e6daf293c75da832d499a39e9aa Mon Sep 17 00:00:00 2001 From: Justin Miller Date: Mon, 28 Sep 2026 08:27:27 -0700 Subject: [PATCH] [HAL:APIC] Let the ACPI driver take over an input the HAL never enabled --- hal/halx86/apic/apic.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hal/halx86/apic/apic.c b/hal/halx86/apic/apic.c index 1c4d400b9b4..67e59513e5a 100644 --- a/hal/halx86/apic/apic.c +++ b/hal/halx86/apic/apic.c @@ -1095,6 +1095,7 @@ HalEnableSystemInterrupt( NTSTATUS Status; ULONG Input; UCHAR Index; + UCHAR Previous; KIRQL OldIrql; ASSERT(Irql <= HIGH_LEVEL); ASSERT((IrqlToTpr(Irql) & 0xF0) == (Vector & 0xF0)); @@ -1131,7 +1132,18 @@ HalEnableSystemInterrupt( return TRUE; } - /* Don't take over an input that belongs to another vector */ + /* The ACPI driver owns the input, so a vector the HAL gave it and never enabled is dropped */ + if (NT_SUCCESS(Status)) + { + Previous = HalpGsivToVector[Input]; + if ((Previous != APIC_FREE_VECTOR) && ApicReadIORedirectionEntry(Input).Mask) + { + HalpVectorToIndex[Previous] = APIC_FREE_VECTOR; + HalpGsivToVector[Input] = APIC_FREE_VECTOR; + } + } + + /* Don't take over an input another vector is using */ if (!NT_SUCCESS(Status) || (HalpGsivToVector[Input] != APIC_FREE_VECTOR)) { HalpReleaseVectorLock(OldIrql);