From 5dfbc067d095b2bbaefad6d77469f4d701bdd539 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 19 May 2025 23:56:22 -0400 Subject: kernel/amd64: Deprecate intr_alloc_vector() Replace intr_alloc_vector() with a cleaner and more machine independent intr_register() Signed-off-by: Ian Moffett --- sys/dev/acpi/uacpi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'sys/dev/acpi') diff --git a/sys/dev/acpi/uacpi.c b/sys/dev/acpi/uacpi.c index 7dbcb35..03d0ecf 100644 --- a/sys/dev/acpi/uacpi.c +++ b/sys/dev/acpi/uacpi.c @@ -259,17 +259,16 @@ uacpi_status uacpi_kernel_install_interrupt_handler(uacpi_u32 irq, uacpi_interrupt_handler fn, uacpi_handle ctx, uacpi_handle *out_irq_handle) { - int vec; + struct intr_hand ih; + + ih.func = (void *)fn; + ih.priority = IPL_HIGH; + ih.irq = irq; + if (intr_register("acpi", &ih) == NULL) { + return UACPI_STATUS_INTERNAL_ERROR; + } -#if defined(__x86_64__) - vec = intr_alloc_vector("acpi", IPL_HIGH); - idt_set_desc(vec, IDT_INT_GATE, ISR(fn), IST_HW_IRQ); - ioapic_set_vec(irq, vec); - ioapic_irq_unmask(irq); return UACPI_STATUS_OK; -#else - return UACPI_STATUS_UNIMPLEMENTED; -#endif /* __x86_64__ */ } uacpi_status -- cgit v1.2.3