summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2020-06-17 06:14:53 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2020-06-17 06:14:53 +0000
commitb7a82ba3056db478b632034db5299b0d0f846a65 (patch)
treef636e5ae1edf45eca8b59762443e2aa25787f097 /sys/arch/amd64/include
parentaf4fb90247e8cc79347e21b2ee42373bc62a96e2 (diff)
pci_intr_establish_cpu() for establishing an interrupt no a specific cpu.
the cpu is specified by a struct cpu_info *, which should generally come from an intrmap. this is adapted from a diff that patrick@ sent round a few years ago for a pci_intr_map_msix_cpuid, where you asked for an msi vector on a specific cpu, and then called pci_intr_establish with the handle you get. kettenis pointed out that it's hard on some archs to carry cpu on a pci interrupt handle, so i tweaked it to turn it into a pci_intr_establish_cpu instead. jmatthew@ and i (but mostly jmatthew@ to be honest) have been experimenting with this api on multiple archs and it is working out well. i'm putting this diff in now on amd64 so people can kick the tyres a bit. tested with hacked up vmx(4), ix(4), and mcx(4)
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r--sys/arch/amd64/include/intr.h6
-rw-r--r--sys/arch/amd64/include/pci_machdep.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/amd64/include/intr.h b/sys/arch/amd64/include/intr.h
index 633fbfc00c2..c70d05e8c26 100644
--- a/sys/arch/amd64/include/intr.h
+++ b/sys/arch/amd64/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.31 2018/12/21 01:51:07 jsg Exp $ */
+/* $OpenBSD: intr.h,v 1.32 2020/06/17 06:14:52 dlg Exp $ */
/* $NetBSD: intr.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */
/*-
@@ -201,8 +201,8 @@ void intr_calculatemasks(struct cpu_info *);
int intr_allocate_slot_cpu(struct cpu_info *, struct pic *, int, int *);
int intr_allocate_slot(struct pic *, int, int, int, struct cpu_info **, int *,
int *);
-void *intr_establish(int, struct pic *, int, int, int, int (*)(void *),
- void *, const char *);
+void *intr_establish(int, struct pic *, int, int, int,
+ struct cpu_info *, int (*)(void *), void *, const char *);
void intr_disestablish(struct intrhand *);
int intr_handler(struct intrframe *, struct intrhand *);
void cpu_intr_init(struct cpu_info *);
diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h
index 2d0cdf16a6e..bc295cc22db 100644
--- a/sys/arch/amd64/include/pci_machdep.h
+++ b/sys/arch/amd64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.28 2019/06/25 16:46:32 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.29 2020/06/17 06:14:52 dlg Exp $ */
/* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */
/*
@@ -87,6 +87,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 *);
#define pci_probe_device_hook(c, a) (0)