aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-06 18:43:28 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-06 18:43:28 +0200
commitf50815110789a0f8f6e5ca66ffd49b26578791a9 (patch)
tree992b3c344e69fab4dc56872566bc7323e8892913 /kapi
parent8d08b3b905d211e989848e1abf3a8ff2535836c8 (diff)
downloadteachos-f50815110789a0f8f6e5ca66ffd49b26578791a9.tar.xz
teachos-f50815110789a0f8f6e5ca66ffd49b26578791a9.zip
kernel: generalize CPU discovery
Diffstat (limited to 'kapi')
-rw-r--r--kapi/include/kapi/acpi.hpp4
-rw-r--r--kapi/include/kapi/platform.hpp37
2 files changed, 37 insertions, 4 deletions
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 <kstd/memory>
@@ -128,9 +127,6 @@ namespace kapi::acpi
auto get_root_pointer() -> kstd::observer_ptr<root_system_description_pointer const>;
- 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<devices::device>;
-
//! @}
} // 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 <kstd/memory>
+
+#include <cstddef>
+#include <cstdint>
+
+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<devices::device>;
+
+ //! @}
+
+} // namespace kapi::platform
+
+#endif \ No newline at end of file