summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/uacpi.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-19 23:56:22 -0400
committerIan Moffett <ian@osmora.org>2025-05-19 23:56:22 -0400
commit5dfbc067d095b2bbaefad6d77469f4d701bdd539 (patch)
treeea38f2a13cd18a7949046bd1697eade81647d361 /sys/dev/acpi/uacpi.c
parent87013e38d1940ad183d3cdb42224fb6dcd9e7e03 (diff)
kernel/amd64: Deprecate intr_alloc_vector()expt
Replace intr_alloc_vector() with a cleaner and more machine independent intr_register() Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/acpi/uacpi.c')
-rw-r--r--sys/dev/acpi/uacpi.c17
1 files changed, 8 insertions, 9 deletions
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