summaryrefslogtreecommitdiff
path: root/Kernel/VM/Region.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-30 23:38:15 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-30 23:40:57 +0200
commit949aef4aef64ce174563c2388f0630be22489b87 (patch)
treeed4c902265a192e3c007e1f7f4ba7d89d6ca246e /Kernel/VM/Region.h
parent027c450d6d5748b69f1718ae2517e47b386c228f (diff)
downloadserenity-949aef4aef64ce174563c2388f0630be22489b87.zip
Kernel: Move syscall implementations out of Process.cpp
This is something I've been meaning to do for a long time, and here we finally go. This patch moves all sys$foo functions out of Process.cpp and into files in Kernel/Syscalls/. It's not exactly one syscall per file (although it could be, but I got a bit tired of the repetitive work here..) This makes hacking on individual syscalls a lot less painful since you don't have to rebuild nearly as much code every time. I'm also hopeful that this makes it easier to understand individual syscalls. :^)
Diffstat (limited to 'Kernel/VM/Region.h')
-rw-r--r--Kernel/VM/Region.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h
index 91c4dd8822..6a40edb3af 100644
--- a/Kernel/VM/Region.h
+++ b/Kernel/VM/Region.h
@@ -225,4 +225,17 @@ private:
mutable OwnPtr<Bitmap> m_cow_map;
};
+inline unsigned prot_to_region_access_flags(int prot)
+{
+ unsigned access = 0;
+ if (prot & PROT_READ)
+ access |= Region::Access::Read;
+ if (prot & PROT_WRITE)
+ access |= Region::Access::Write;
+ if (prot & PROT_EXEC)
+ access |= Region::Access::Execute;
+ return access;
+}
+
+
}