From f50815110789a0f8f6e5ca66ffd49b26578791a9 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 6 Apr 2026 18:43:28 +0200 Subject: kernel: generalize CPU discovery --- kapi/include/kapi/acpi.hpp | 4 ---- kapi/include/kapi/platform.hpp | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 kapi/include/kapi/platform.hpp (limited to 'kapi') diff --git a/kapi/include/kapi/acpi.hpp b/kapi/include/kapi/acpi.hpp index 5d55d08..75b6c48 100644 --- a/kapi/include/kapi/acpi.hpp +++ b/kapi/include/kapi/acpi.hpp @@ -1,7 +1,6 @@ #ifndef TEACHOS_KAPI_ACPI_HPP #define TEACHOS_KAPI_ACPI_HPP -#include "kapi/devices.hpp" #include "kapi/memory.hpp" #include @@ -128,9 +127,6 @@ namespace kapi::acpi auto get_root_pointer() -> kstd::observer_ptr; - auto create_local_interrupt_controller(std::size_t major, std::size_t minor, std::uint64_t hardware_id, - memory::physical_address address) -> kstd::unique_ptr; - //! @} } // namespace kapi::acpi diff --git a/kapi/include/kapi/platform.hpp b/kapi/include/kapi/platform.hpp new file mode 100644 index 0000000..6aae795 --- /dev/null +++ b/kapi/include/kapi/platform.hpp @@ -0,0 +1,37 @@ +#ifndef TEACHOS_KAPI_PLATFORM_HPP +#define TEACHOS_KAPI_PLATFORM_HPP + +#include "kapi/devices.hpp" + +#include + +#include +#include + +namespace kapi::platform +{ + + //! @addtogroup kapi-platform-kernel-defined + //! @{ + + auto cpu_detected(kapi::devices::bus & bus, std::uint64_t hardware_id, bool is_bsp) -> bool; + + //! @} + + //! @addtogroup kapi-platform-platform-defined + //! @{ + + //! Discover the CPU topology of the platform and attach it to the given CPU bus. + //! + //! @param bus The bus to attach the CPU topology to. + //! @return true iff. the CPU topology was discovered successfully, false otherwise. + auto discover_cpu_topology(kapi::devices::bus & bus) -> bool; + + auto create_core_interrupt_controller(std::size_t major, std::size_t minor, std::uint64_t hardware_id) + -> kstd::unique_ptr; + + //! @} + +} // namespace kapi::platform + +#endif \ No newline at end of file -- cgit v1.2.3