summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-29 20:55:40 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-29 20:55:40 +0200
commit0e53b1d1ade965e2878e7965f1e83fdc58c6fdb4 (patch)
treeb2d9686e66ffec7320825f4e50568558c3feb1eb /Kernel
parent10e0e13bf326fd1c2f73771267b9de6b701aa6cb (diff)
downloadserenity-0e53b1d1ade965e2878e7965f1e83fdc58c6fdb4.zip
Kernel: Add some convenient getters to Region
Add getters for the underlying Range, the access bits, and also add contains(Range) which just wraps m_range.contains().
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/VM/Region.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h
index 5d4a12cf89..4f07ce9620 100644
--- a/Kernel/VM/Region.h
+++ b/Kernel/VM/Region.h
@@ -27,12 +27,14 @@ public:
~Region();
+ const Range& range() const { return m_range; }
VirtualAddress vaddr() const { return m_range.base(); }
size_t size() const { return m_range.size(); }
bool is_readable() const { return m_access & Access::Read; }
bool is_writable() const { return m_access & Access::Write; }
bool is_executable() const { return m_access & Access::Execute; }
const String& name() const { return m_name; }
+ unsigned access() const { return m_access; }
void set_name(const String& name) { m_name = name; }
@@ -51,6 +53,11 @@ public:
return m_range.contains(vaddr);
}
+ bool contains(const Range& range) const
+ {
+ return m_range.contains(range);
+ }
+
unsigned page_index_from_address(VirtualAddress vaddr) const
{
return (vaddr - m_range.base()).get() / PAGE_SIZE;