summaryrefslogtreecommitdiff
path: root/src/sys/include/io
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-20 17:20:14 -0400
committerIan Moffett <ian@osmora.org>2025-09-20 17:20:14 -0400
commitaac5073d768926322ec38ca7153fd8f14e20a88e (patch)
tree4bce8611edf8de1e29989040c36f9ac2807ad752 /src/sys/include/io
parentcf7b0f95d9579de8302f60345ef8ed05e2ebef50 (diff)
kern: pci: Add bus framework and PCI BAR mapper
Signed-off-by: Ian Moffett <ian@osmora.org>
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_ */