aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-08 17:17:11 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-08 17:17:11 +0200
commitaa208226f992523865328d4612ae4a7679f57a04 (patch)
tree41981f9b72f695ffc2848bfb9e13b1846c1ebe69 /kapi
parent1ecc0c223a1bacfa1aee183a3573f57c265318df (diff)
downloadteachos-aa208226f992523865328d4612ae4a7679f57a04.tar.xz
teachos-aa208226f992523865328d4612ae4a7679f57a04.zip
kapi: return region pair for MMIO allocation
Diffstat (limited to 'kapi')
-rw-r--r--kapi/include/kapi/memory.hpp12
1 files changed, 7 insertions, 5 deletions
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<linear_address, std::size_t>;
+
//! @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;
//! @}