From 36248bb63a396dfea762d5b2cf028bf4b7a2b62e Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 28 Jul 2026 13:09:08 +0200 Subject: x86_64: split lapic according to UDM --- arch/x86_64/kapi/devices.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'arch/x86_64/kapi/devices.cpp') diff --git a/arch/x86_64/kapi/devices.cpp b/arch/x86_64/kapi/devices.cpp index 748e0a6a..04b6fa2d 100644 --- a/arch/x86_64/kapi/devices.cpp +++ b/arch/x86_64/kapi/devices.cpp @@ -1,11 +1,21 @@ #include +#include #include #include +#include + +#include + namespace kapi::devices { + namespace + { + auto static constinit cpu_bus = kstd::shared_ptr{}; + } + auto init_platform_drivers() -> void { arch::drivers::init_legacy_drivers(); @@ -17,4 +27,25 @@ namespace kapi::devices arch::devices::init_legacy_devices(); } + auto get_cpu_bus() -> kstd::shared_ptr + { + if (!cpu_bus) + { + system::panic("[x86_64:DEV] The CPU topology has not yet been initialized!"); + } + + return cpu_bus; + } + + auto discover_cpu_topology() -> void + { + if (cpu_bus) + { + system::panic("[x86_64:DEV] The CPU topology has already been initialized!"); + } + + cpu_bus = kstd::make_shared(); + cpu_bus->facet()->enumerate(*cpu_bus); + } + } // namespace kapi::devices \ No newline at end of file -- cgit v1.2.3