diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-20 17:20:14 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-20 17:20:14 -0400 |
commit | aac5073d768926322ec38ca7153fd8f14e20a88e (patch) | |
tree | 4bce8611edf8de1e29989040c36f9ac2807ad752 /src/sys/include/io | |
parent | cf7b0f95d9579de8302f60345ef8ed05e2ebef50 (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.h | 14 |
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_ */ |