aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-08-18 13:51:55 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-08-18 13:51:55 +0200
commitcd665ec172dadd049e7c1830b070f15b58fb9011 (patch)
tree42c2eb8ecb984d179263f68cab1c6c2667e8dd2c /arch
parent5754a8591252da5d5eeb4281064f0b82bfdc03a8 (diff)
downloadkernel-cd665ec172dadd049e7c1830b070f15b58fb9011.tar.xz
kernel-cd665ec172dadd049e7c1830b070f15b58fb9011.zip
kstd: flatten units namespace
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/arch/bus/cpu.cpp2
-rw-r--r--arch/x86_64/arch/drivers/cpu/lapic.hpp2
-rw-r--r--arch/x86_64/arch/memory/kernel_mapper.cpp3
-rw-r--r--arch/x86_64/arch/memory/page_table.hpp2
-rw-r--r--arch/x86_64/kapi/memory.cpp4
5 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86_64/arch/bus/cpu.cpp b/arch/x86_64/arch/bus/cpu.cpp
index 0a0e94ec..4b9edffc 100644
--- a/arch/x86_64/arch/bus/cpu.cpp
+++ b/arch/x86_64/arch/bus/cpu.cpp
@@ -27,7 +27,7 @@ namespace arch::bus
constexpr auto candidate_flags = ::acpi::processor_local_apic_entry::flags::processor_enabled //
| ::acpi::processor_local_apic_entry::flags::online_capable;
- constexpr auto lapic_mmio_range_size = kstd::units::bytes{0x400};
+ constexpr auto lapic_mmio_range_size = kstd::bytes{0x400};
struct protocol final : kapi::devices::bus_protocol
{
diff --git a/arch/x86_64/arch/drivers/cpu/lapic.hpp b/arch/x86_64/arch/drivers/cpu/lapic.hpp
index f2a8a4e9..678d364a 100644
--- a/arch/x86_64/arch/drivers/cpu/lapic.hpp
+++ b/arch/x86_64/arch/drivers/cpu/lapic.hpp
@@ -40,6 +40,6 @@ namespace arch::drivers::cpu
bool m_is_mapped{};
};
-} // namespace arch::drivers
+} // namespace arch::drivers::cpu
#endif
diff --git a/arch/x86_64/arch/memory/kernel_mapper.cpp b/arch/x86_64/arch/memory/kernel_mapper.cpp
index 0ddf08dd..a15a1d9e 100644
--- a/arch/x86_64/arch/memory/kernel_mapper.cpp
+++ b/arch/x86_64/arch/memory/kernel_mapper.cpp
@@ -74,8 +74,7 @@ namespace arch::memory
auto kernel_mapper::map_section(section_header_type const & section, std::string_view name,
kapi::memory::page_mapper & mapper) -> void
{
- auto number_of_pages =
- (kstd::units::bytes{section.size} + (kapi::memory::page::size - 1_B)) / kapi::memory::page::size;
+ auto number_of_pages = (kstd::bytes{section.size} + (kapi::memory::page::size - 1_B)) / kapi::memory::page::size;
auto linear_start_address = kapi::memory::linear_address{section.virtual_load_address};
auto physical_start_address = kapi::memory::physical_address{section.virtual_load_address & ~m_kernel_load_base};
diff --git a/arch/x86_64/arch/memory/page_table.hpp b/arch/x86_64/arch/memory/page_table.hpp
index 5bb4e1aa..12abacb5 100644
--- a/arch/x86_64/arch/memory/page_table.hpp
+++ b/arch/x86_64/arch/memory/page_table.hpp
@@ -117,7 +117,7 @@ namespace arch::memory
};
//! The maximum number of entries in this table.
- constexpr auto static entry_count{kapi::memory::page::size / kstd::units::bytes{sizeof(entry)}};
+ constexpr auto static entry_count{kapi::memory::page::size / kstd::bytes{sizeof(entry)}};
//! Get the entry at the given index.
//!
diff --git a/arch/x86_64/kapi/memory.cpp b/arch/x86_64/kapi/memory.cpp
index a6f84f07..37b4c7f3 100644
--- a/arch/x86_64/kapi/memory.cpp
+++ b/arch/x86_64/kapi/memory.cpp
@@ -129,7 +129,7 @@ namespace kapi::memory
auto module_physical_start = physical_address{module.start_address};
auto module_virtual_start =
linear_address{module.start_address + std::bit_cast<std::uintptr_t>(&arch::boot::TEACHOS_VMA)};
- auto module_size = static_cast<kstd::units::bytes>(module.end_address - module.start_address);
+ auto module_size = static_cast<kstd::bytes>(module.end_address - module.start_address);
auto module_block_count = (module_size + frame::size - 1_B) / frame::size;
for (auto i = 0uz; i < module_block_count; ++i)
@@ -150,7 +150,7 @@ namespace kapi::memory
}))
{
auto start = frame::containing(physical_address{region.base});
- auto count = kstd::units::bytes{region.size_in_B} / page::size;
+ auto count = kstd::bytes{region.size_in_B} / page::size;
new_allocator.release_many({start, count});
}