diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-07-23 01:38:56 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-07-23 01:38:56 +0200 |
| commit | 526709a1e86d55dd88e2dbdbc471795efce9046b (patch) | |
| tree | 04d9de462f506f983d3a991179eccfd68300cc14 /arch | |
| parent | 0361a4912affe1594def1aa24e387fe5440afaee (diff) | |
| download | kernel-526709a1e86d55dd88e2dbdbc471795efce9046b.tar.xz kernel-526709a1e86d55dd88e2dbdbc471795efce9046b.zip | |
kapi: bootstrap owning device tree
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86_64/arch/devices/init.cpp | 8 | ||||
| -rw-r--r-- | arch/x86_64/kapi/cpu.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86_64/arch/devices/init.cpp b/arch/x86_64/arch/devices/init.cpp index 4ac287cf..2c4fb3c3 100644 --- a/arch/x86_64/arch/devices/init.cpp +++ b/arch/x86_64/arch/devices/init.cpp @@ -62,13 +62,13 @@ namespace arch::devices { kstd::println("[x86_64:DEV] Initializing ISA bus..."); - auto isa_bus = kstd::make_unique<arch::bus::isa>(); + auto isa_bus = kstd::make_shared<arch::bus::isa>(); - auto pit = kstd::make_unique<arch::devices::legacy_pit>(pit_frequency_in_hz); + auto pit = kstd::make_shared<arch::devices::legacy_pit>(pit_frequency_in_hz); isa_bus->add_child(std::move(pit)); - auto & root_bus = kapi::devices::get_root_bus(); - root_bus.add_child(std::move(isa_bus)); + auto root_bus = kapi::devices::get_root_bus(); + root_bus->add_child(std::move(isa_bus)); } } // namespace arch::devices diff --git a/arch/x86_64/kapi/cpu.cpp b/arch/x86_64/kapi/cpu.cpp index bd86f0fa..c45703e5 100644 --- a/arch/x86_64/kapi/cpu.cpp +++ b/arch/x86_64/kapi/cpu.cpp @@ -64,19 +64,19 @@ namespace kapi::cpu auto bsp_found = false; auto core_index = 0uz; auto local_apic_address = memory::physical_address{madt->local_interrupt_controller_address()}; - auto cpu_bus = kstd::make_unique<devices::cpu>(); + auto cpu_bus = kstd::make_shared<devices::cpu>(); for (auto const & apic : lapic_entries) { auto is_bsp = !bsp_found; bsp_found = true; - auto core = kstd::make_unique<devices::cpu::core>(core_index, apic.processor_id(), is_bsp); - core->add_child(kstd::make_unique<arch::devices::local_apic>(core_index, apic.id(), local_apic_address, is_bsp)); + auto core = kstd::make_shared<devices::cpu::core>(core_index, apic.processor_id(), is_bsp); + core->add_child(kstd::make_shared<arch::devices::local_apic>(core_index, apic.id(), local_apic_address, is_bsp)); cpu_bus->add_child(std::move(core)); ++core_index; } - devices::get_root_bus().add_child(std::move(cpu_bus)); + devices::get_root_bus()->add_child(std::move(cpu_bus)); kstd::println("[x86_64:PLT] Found {} CPU cores", core_index); return core_index > 0; |
