mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Clean up Region access bit setters a little
This commit is contained in:
parent
336ac9e8e7
commit
7a0088c4d2
Notes:
sideshowbarker
2024-07-19 10:42:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7a0088c4d2a
1 changed files with 11 additions and 15 deletions
|
@ -109,21 +109,9 @@ public:
|
|||
|
||||
u32 cow_pages() const;
|
||||
|
||||
void set_writable(bool b)
|
||||
{
|
||||
if (b)
|
||||
m_access |= Access::Write;
|
||||
else
|
||||
m_access &= ~Access::Write;
|
||||
}
|
||||
|
||||
void set_readable(bool b)
|
||||
{
|
||||
if (b)
|
||||
m_access |= Access::Read;
|
||||
else
|
||||
m_access &= ~Access::Read;
|
||||
}
|
||||
void set_readable(bool b) { set_access_bit(Access::Read, b); }
|
||||
void set_writable(bool b) { set_access_bit(Access::Write, b); }
|
||||
void set_executable(bool b) { set_access_bit(Access::Execute, b); }
|
||||
|
||||
void map(PageDirectory&);
|
||||
enum class ShouldDeallocateVirtualMemoryRange {
|
||||
|
@ -147,6 +135,14 @@ public:
|
|||
private:
|
||||
Bitmap& ensure_cow_map() const;
|
||||
|
||||
void set_access_bit(Access access, bool b)
|
||||
{
|
||||
if (b)
|
||||
m_access |= access;
|
||||
else
|
||||
m_access &= ~access;
|
||||
}
|
||||
|
||||
PageFaultResponse handle_cow_fault(size_t page_index);
|
||||
PageFaultResponse handle_inode_fault(size_t page_index);
|
||||
PageFaultResponse handle_zero_fault(size_t page_index);
|
||||
|
|
Loading…
Reference in a new issue