From aa208226f992523865328d4612ae4a7679f57a04 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 8 Apr 2026 17:17:11 +0200 Subject: kapi: return region pair for MMIO allocation --- kapi/include/kapi/memory.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'kapi') diff --git a/kapi/include/kapi/memory.hpp b/kapi/include/kapi/memory.hpp index ae33904..f5e126a 100644 --- a/kapi/include/kapi/memory.hpp +++ b/kapi/include/kapi/memory.hpp @@ -16,6 +16,8 @@ namespace kapi::memory { + using mmio_region = std::pair; + //! @addtogroup kapi-memory-kernel-defined //! @{ @@ -89,7 +91,7 @@ namespace kapi::memory //! //! @warning This function will panic if the MMIO system has not been initialized! //! @param page_count The number of pages to allocate. - auto allocate_mmio_region(std::size_t page_count) -> linear_address; + auto allocate_mmio_region(std::size_t page_count) -> mmio_region; //! Map a region of Memory-mapped I/O address space to a given hardware address using the given flags. //! @@ -98,16 +100,16 @@ namespace kapi::memory //! //! This function will always set the @p uncached flag. //! - //! @param base The base of the virtual region. + //! @param region The region to map. //! @param hw_base The base of the hardware region. //! @param flags The flags to apply. - auto map_mmio_region(linear_address base, physical_address hw_base, page_mapper::flags flags = {}) -> std::byte *; + auto map_mmio_region(mmio_region region, physical_address hw_base, page_mapper::flags flags = {}) -> std::byte *; //! Release a Memory-mapped I/O region. //! //! @warning This function will panic if the MMIO system has not been initialized! - //! @param base The start address of the region to release. - auto release_mmio_region(linear_address base) -> void; + //! @param region The region to release. + auto release_mmio_region(mmio_region region) -> void; //! @} -- cgit v1.2.3