aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'kapi')
-rw-r--r--kapi/kapi/memory.hpp7
-rw-r--r--kapi/kapi/memory/page_mapper.hpp17
2 files changed, 17 insertions, 7 deletions
diff --git a/kapi/kapi/memory.hpp b/kapi/kapi/memory.hpp
index 4cdd6ac1..7979c7e1 100644
--- a/kapi/kapi/memory.hpp
+++ b/kapi/kapi/memory.hpp
@@ -103,9 +103,12 @@ namespace kapi::memory
//! Map a region of Memory-mapped I/O address space to a given hardware address using the given flags.
//!
//! @warning This function will panic if no page mapper has been registered, or the page has already been mapped.
- //! This function will not ensure that the frame is not already in use.
//!
- //! This function will always set the @p uncached flag.
+ //! @warning This function will not ensure that the frame is not already in use.
+ //!
+ //! @warning This function will panic if an attempt is made to map an MMIO region as executable.
+ //!
+ //! This function will always set the @p uncached, @p global, and @p supervisor_only flags.
//!
//! @param region The region to map.
//! @param hw_base The base of the hardware region.
diff --git a/kapi/kapi/memory/page_mapper.hpp b/kapi/kapi/memory/page_mapper.hpp
index 4a4827b6..889ef052 100644
--- a/kapi/kapi/memory/page_mapper.hpp
+++ b/kapi/kapi/memory/page_mapper.hpp
@@ -32,11 +32,18 @@ namespace kapi::memory
enum struct flags : std::uint64_t
{
empty,
- writable = 1 << 0, //! The page is writable.
- executable = 1 << 1, //! The page contains executable instructions.
- uncached = 1 << 2, //! The page contents must not be cached.
- supervisor_only = 1 << 3, //! The page is only accessible in supervisor mode.
- global = 1 << 4, //! The page translation persists across context switches.
+ //! The page is writable.
+ writable = 1 << 0,
+ //! The page contains executable instructions.
+ executable = 1 << 1,
+ //! The page contents must not be cached.
+ uncached = 1 << 2,
+ //! The page is only accessible in supervisor mode.
+ supervisor_only = 1 << 3,
+ //! The page translation persists across context switches.
+ //!
+ //! @note A given platform may not honor this flag.
+ global = 1 << 4,
};
virtual ~page_mapper() = default;