From aac5073d768926322ec38ca7153fd8f14e20a88e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 20 Sep 2025 17:20:14 -0400 Subject: kern: pci: Add bus framework and PCI BAR mapper Signed-off-by: Ian Moffett --- src/sys/include/io/pci/bar.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/sys/include/io') 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 #include +#include #include #include @@ -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_ */ -- cgit v1.2.3