diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-05 13:48:07 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-05 13:48:07 +0100 |
commit | 2d045d2a647ad5fab57fbb1ec8339a44b9770cc3 (patch) | |
tree | f00f3e64819657f25f3d36c56c3e0076d63d82a6 /Kernel/Process.h | |
parent | e85c22fe58a39aa930251ad5e14c7dd6979a163f (diff) | |
download | serenity-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/Process.h')
-rw-r--r-- | Kernel/Process.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h index 2d8acee68c..c6cb4d49cb 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -236,6 +236,24 @@ private: Process::State m_original_state { Process::Invalid }; }; +static inline const char* toString(Process::State state) +{ + switch (state) { + case Process::Invalid: return "Invalid"; + case Process::Runnable: return "Runnable"; + case Process::Running: return "Running"; + case Process::Terminated: return "Term"; + case Process::Crashing: return "Crash"; + case Process::Exiting: return "Exit"; + case Process::BlockedSleep: return "Sleep"; + case Process::BlockedWait: return "Wait"; + case Process::BlockedRead: return "Read"; + case Process::BeingInspected: return "Inspect"; + } + ASSERT_NOT_REACHED(); + return nullptr; +} + extern void yield(); extern bool scheduleNewProcess(); extern void switchNow(); |