summaryrefslogtreecommitdiff
path: root/Kernel/types.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-05 13:48:07 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-05 13:48:07 +0100
commit2d045d2a647ad5fab57fbb1ec8339a44b9770cc3 (patch)
treef00f3e64819657f25f3d36c56c3e0076d63d82a6 /Kernel/types.h
parente85c22fe58a39aa930251ad5e14c7dd6979a163f (diff)
downloadserenity-2d045d2a647ad5fab57fbb1ec8339a44b9770cc3.zip
Implement COW pages! :^)
sys$fork() now clones all writable regions with per-page COW bits. The pages are then mapped read-only and we handle a PF by COWing the pages. This is quite delightful. Obviously there's lots of work to do still, and it needs better data structures, but the general concept works.
Diffstat (limited to 'Kernel/types.h')
-rw-r--r--Kernel/types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/types.h b/Kernel/types.h
index 8a61b405a5..4fd1375ef0 100644
--- a/Kernel/types.h
+++ b/Kernel/types.h
@@ -105,3 +105,8 @@ public:
private:
dword m_address { 0 };
};
+
+inline LinearAddress operator-(const LinearAddress& a, const LinearAddress& b)
+{
+ return LinearAddress(a.get() - b.get());
+}