[HAL:APIC] Let the ACPI driver take over an input the HAL never enabled

This commit is contained in:
Justin Miller
2026-09-28 08:27:27 -07:00
parent 5ef14539d3
commit b60e24ccb5

View File

@@ -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);