summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2020-06-17 06:17:20 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2020-06-17 06:17:20 +0000
commita728c34a9d460ef77f4adc8e76d6dafc1b1ead98 (patch)
tree354905086e34dbabd6ea465a1f77afb6c414196b
parentb7a82ba3056db478b632034db5299b0d0f846a65 (diff)
add a dumb pci_intr_establish_cpu().
i386 doesnt support msix, and the interrupt code assumes that it only ties stuff to cpu0. this mostly exists so the api exists for multiq drivers to compile against, but fail with when they try to use it. tested with a hacked up vmx(4).
-rw-r--r--sys/arch/i386/pci/pci_machdep.c13
-rw-r--r--sys/arch/i386/pci/pci_machdep.h5
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c
index 0e4416af08e..d301dab8eac 100644
--- a/sys/arch/i386/pci/pci_machdep.c
+++ b/sys/arch/i386/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.85 2019/01/07 23:44:11 bluhm Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.86 2020/06/17 06:17:19 dlg Exp $ */
/* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */
/*-
@@ -788,6 +788,17 @@ extern struct intrhand *apic_intrhand[256];
extern int apic_maxlevel[256];
void *
+pci_intr_establish_cpu(pci_chipset_tag_t pc, pci_intr_handle_t ih,
+ int level, struct cpu_info *ci,
+ int (*func)(void *), void *arg, const char *what)
+{
+ if (ci != NULL && ci != &cpu_info_primary)
+ return (NULL);
+
+ return pci_intr_establish(pc, ih, level, func, arg, what);
+}
+
+void *
pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
int (*func)(void *), void *arg, const char *what)
{
diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h
index 3d2f214262a..fc2285392da 100644
--- a/sys/arch/i386/pci/pci_machdep.h
+++ b/sys/arch/i386/pci/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.31 2020/03/20 13:15:49 mpi Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.32 2020/06/17 06:17:19 dlg Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */
/*
@@ -100,6 +100,9 @@ int pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
int, int (*)(void *), void *, const char *);
+void *pci_intr_establish_cpu(pci_chipset_tag_t, pci_intr_handle_t,
+ int, struct cpu_info *,
+ int (*)(void *), void *, const char *);
void pci_intr_disestablish(pci_chipset_tag_t, void *);
void pci_decompose_tag(pci_chipset_tag_t, pcitag_t,
int *, int *, int *);