From 27a58a338ad2f61a063df02488fc497405afc492 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 12 Nov 2026 22:46:57 +0100 Subject: dev/pcie: implement initial detection --- kapi/kapi/devices.hpp | 1 + kapi/kapi/devices/pci_express.hpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 kapi/kapi/devices/pci_express.hpp (limited to 'kapi') diff --git a/kapi/kapi/devices.hpp b/kapi/kapi/devices.hpp index c7de1830..d97e88b6 100644 --- a/kapi/kapi/devices.hpp +++ b/kapi/kapi/devices.hpp @@ -9,6 +9,7 @@ #include // IWYU pragma: export #include // IWYU pragma: export #include // IWYU pragma: export +#include // IWYU pragma: export #include // IWYU pragma: export #include // IWYU pragma: export diff --git a/kapi/kapi/devices/pci_express.hpp b/kapi/kapi/devices/pci_express.hpp new file mode 100644 index 00000000..6acb279f --- /dev/null +++ b/kapi/kapi/devices/pci_express.hpp @@ -0,0 +1,32 @@ +#ifndef TEACHOS_KAPI_DEVICES_PCI_EXPRESS_HPP +#define TEACHOS_KAPI_DEVICES_PCI_EXPRESS_HPP + +// IWYU pragma: private, include + +#include + +#include + +namespace kapi::devices +{ + + struct pcie_segment_descriptor + { + std::uintptr_t base_address; + std::uint8_t first_bus; + std::uint8_t last_bus; + }; + + //! @name Platform-defined API + //! @{ + + //! Get a list of all PCI Express segments in the system. + //! + //! @return a list of PCI Express segment descriptors. + auto get_pci_express_segment_descriptors() -> kstd::vector; + + //! @} + +} // namespace kapi::devices + +#endif \ No newline at end of file -- cgit v1.2.3