summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/pci/pci_machdep.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/arch/amd64/pci/pci_machdep.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/arch/amd64/pci/pci_machdep.c')
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index 43065b0..7eaee6a 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -163,6 +163,7 @@ pci_enable_msix(struct pci_device *dev, const struct msi_intr *intr)
{
volatile uint64_t *tbl;
struct cpu_info *ci;
+ struct intr_hand ih, *ih_res;
uint32_t data, msg_ctl;
uint64_t msg_addr, tmp;
uint16_t tbl_off;
@@ -184,9 +185,14 @@ pci_enable_msix(struct pci_device *dev, const struct msi_intr *intr)
tbl = (void *)((dev->bar[bir] & PCI_BAR_MEMMASK) + MMIO_OFFSET);
tbl = (void *)((char *)tbl + tbl_off);
- /* Get the vector and setup handler */
- vector = intr_alloc_vector(intr->name, IPL_BIO);
- idt_set_desc(vector, IDT_INT_GATE, ISR(intr->handler), 0);
+ ih.func = intr->handler;
+ ih.priority = IPL_BIO;
+ ih.irq = -1;
+ ih_res = intr_register(intr->name, &ih);
+ if (ih_res == NULL) {
+ return -EIO;
+ }
+ vector = ih_res->vector;
/*
* Setup the message data at bits 95:64 of the message