summaryrefslogtreecommitdiff
path: root/src/sys/include/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/include/io')
-rw-r--r--src/sys/include/io/pci/bar.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sys/include/io/pci/bar.h b/src/sys/include/io/pci/bar.h
index 6bb4367..14164ef 100644
--- a/src/sys/include/io/pci/bar.h
+++ b/src/sys/include/io/pci/bar.h
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/cdefs.h>
+#include <os/bus.h>
#include <io/pci/pci.h>
#include <io/pci/cam.h>
@@ -68,4 +69,17 @@ pci_get_barreg(uint8_t bar)
*/
ssize_t pci_bar_size(struct pci_device *dev, uint8_t bar);
+/*
+ * Map a BAR into host address space for the current
+ * process.
+ *
+ * @dev: Device of BAR to map
+ * @bar: BAR number of BAR to map
+ * @bs_res: Result is written here
+ *
+ * Returns zero on success, otherwise a less than
+ * zero value to indicate failure.
+ */
+int pci_map_bar(struct pci_device *dev, uint8_t bar, struct bus_space *bs_res);
+
#endif /* !_PCI_BAR_H_ */