diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-18 15:35:22 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-18 15:35:22 -0400 |
commit | dceb243a1a50364d5510ae4495ac2def8d3536ee (patch) | |
tree | be9053950ff08f156f37c97aaa0024022c7862f5 /src/sys/io/pci/pci.c | |
parent | a84c4e18ed47d015d2abbaa2a4411a64a0ade18f (diff) |
kern: pci: Make max buses to scan configurable
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/io/pci/pci.c')
-rw-r--r-- | src/sys/io/pci/pci.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sys/io/pci/pci.c b/src/sys/io/pci/pci.c index ba96670..fcb5a8b 100644 --- a/src/sys/io/pci/pci.c +++ b/src/sys/io/pci/pci.c @@ -35,7 +35,14 @@ #include <io/pci/pci.h> #include <io/pci/cam.h> -#define PCI_BUS_ROOT 0 +#if defined(__PCI_MAX_BUS) +#define PCI_MAX_BUS __PCI_MAX_BUS +#if PCI_MAX_BUS > 256 +#error "PCI_MAX_BUS must be <= 256" +#endif /* PCI_MAX_BUS */ +#else +#define PCI_MAX_BUS 1 +#endif /* __PCI_MAX_BUS */ static struct cam_hook cam; @@ -160,5 +167,8 @@ pci_init_bus(void) panic("pci_init_bus: failed to init CAM\n"); } - pci_enum_bus(PCI_BUS_ROOT); + printf("pci: enumerating %d buses\n", PCI_MAX_BUS); + for (int i = 0; i < PCI_MAX_BUS; ++i) { + pci_enum_bus(i); + } } |