aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorvin Köhne <corvink@FreeBSD.org>2023-05-10 10:19:49 +0000
committerCorvin Köhne <corvink@FreeBSD.org>2023-05-11 12:30:19 +0000
commit60793cee27993048864f60e3c19039386e4a4ab0 (patch)
tree9205fb8d5b63f7949f761191ba61ed81225c1815
parentca14781c8170f3517ae79e198c0c880dbc3142dd (diff)
downloadsrc-60793cee27993048864f60e3c19039386e4a4ab0.tar.gz
src-60793cee27993048864f60e3c19039386e4a4ab0.zip
bhyve: make passthru sel public available
The GVT-d emulation requires access to this selector to read from the device. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D40035
-rw-r--r--usr.sbin/bhyve/pci_passthru.c8
-rw-r--r--usr.sbin/bhyve/pci_passthru.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
index b5c83f302f0e..054b284a2f27 100644
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -660,6 +660,14 @@ done:
return (error);
}
+struct pcisel *
+passthru_get_sel(struct passthru_softc *sc)
+{
+ assert(sc != NULL);
+
+ return (&sc->psc_sel);
+}
+
int
set_pcir_handler(struct passthru_softc *sc, int reg, int len,
cfgread_handler rhandler, cfgwrite_handler whandler)
diff --git a/usr.sbin/bhyve/pci_passthru.h b/usr.sbin/bhyve/pci_passthru.h
index e999e84f85f2..79578a8496c4 100644
--- a/usr.sbin/bhyve/pci_passthru.h
+++ b/usr.sbin/bhyve/pci_passthru.h
@@ -24,5 +24,6 @@ int passthru_cfgread_emulate(struct passthru_softc *sc, struct pci_devinst *pi,
int coff, int bytes, uint32_t *rv);
int passthru_cfgwrite_emulate(struct passthru_softc *sc, struct pci_devinst *pi,
int coff, int bytes, uint32_t val);
+struct pcisel *passthru_get_sel(struct passthru_softc *sc);
int set_pcir_handler(struct passthru_softc *sc, int reg, int len,
cfgread_handler rhandler, cfgwrite_handler whandler);