diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-04-08 17:17:11 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-04-08 17:17:11 +0200 |
| commit | aa208226f992523865328d4612ae4a7679f57a04 (patch) | |
| tree | 41981f9b72f695ffc2848bfb9e13b1846c1ebe69 /arch | |
| parent | 1ecc0c223a1bacfa1aee183a3573f57c265318df (diff) | |
| download | teachos-aa208226f992523865328d4612ae4a7679f57a04.tar.xz teachos-aa208226f992523865328d4612ae4a7679f57a04.zip | |
kapi: return region pair for MMIO allocation
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86_64/include/arch/devices/local_apic.hpp | 2 | ||||
| -rw-r--r-- | arch/x86_64/src/devices/local_apic.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86_64/include/arch/devices/local_apic.hpp b/arch/x86_64/include/arch/devices/local_apic.hpp index 946e4af..ee1073f 100644 --- a/arch/x86_64/include/arch/devices/local_apic.hpp +++ b/arch/x86_64/include/arch/devices/local_apic.hpp @@ -25,7 +25,7 @@ namespace arch::devices std::uint64_t m_hardware_id{}; kapi::memory::physical_address m_base{}; - kapi::memory::linear_address m_virtual_base{}; + kapi::memory::mmio_region m_mapped_region{}; bool m_is_bsp{}; std::uint8_t m_version{}; std::uint8_t m_highest_lvt_entry_index{}; diff --git a/arch/x86_64/src/devices/local_apic.cpp b/arch/x86_64/src/devices/local_apic.cpp index 54d87a6..4a81de8 100644 --- a/arch/x86_64/src/devices/local_apic.cpp +++ b/arch/x86_64/src/devices/local_apic.cpp @@ -97,7 +97,7 @@ namespace arch::devices is_mapped = true; } - m_virtual_base = shared_virtual_base; + m_mapped_region = shared_virtual_base; if (m_is_bsp) { @@ -108,12 +108,12 @@ namespace arch::devices write_register(registers::spurious_interrupt_vector, lapic_enable_bit | spurious_interrupt_vector); - kstd::println("[x86_64:DEV] LAPIC initialized. version: {#x} | max_lvt_entry: {} | eoi_suppresion: {:s}", + kstd::println("[x86_64:DEV] LAPIC initialized. version: {#x} | max_lvt_entry: {} | eoi_suppression: {:s}", m_version, m_highest_lvt_entry_index, m_supports_eoi_broadcast_suppression); } else { - kstd::println("[x86_64:DEV] LAPIC {} is not on the BSP, deferring intialization.", m_hardware_id); + kstd::println("[x86_64:DEV] LAPIC {} is not on the BSP, deferring initialization.", m_hardware_id); } return true; @@ -121,13 +121,13 @@ namespace arch::devices auto local_apic::read_register(registers id) const -> std::uint32_t { - auto reg = static_cast<std::uint32_t volatile *>(m_virtual_base + std::to_underlying(id)); + auto reg = static_cast<std::uint32_t volatile *>(m_mapped_region.first + std::to_underlying(id)); return *reg; } auto local_apic::write_register(registers id, std::uint32_t value) -> void { - auto reg = static_cast<std::uint32_t volatile *>(m_virtual_base + std::to_underlying(id)); + auto reg = static_cast<std::uint32_t volatile *>(m_mapped_region.first + std::to_underlying(id)); *reg = value; } |
