summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2023-04-04 19:40:10 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2023-04-06 20:30:03 +0300
commit65641187ffb15e3512fcf9c260c02287f83b5d09 (patch)
tree9abd23866fa987c9412315e61ff9001f3068f954 /Kernel/Process.h
parent3f89a1b1314a080b5f3a3c9555b22a81efc80513 (diff)
downloadserenity-65641187ffb15e3512fcf9c260c02287f83b5d09.zip
Kernel: Restructure execve to ensure Process::m_space is always in use
Instead of setting up the new address space on it's own, and only swap to the new address space at the end, we now immediately swap to the new address space (while still keeping the old one alive) and only revert back to the old one if we fail at any point. This is done to ensure that the process' active address space (aka the contents of m_space) always matches actual address space in use by it. That should allow us to eventually make the page fault handler process- aware, which will let us properly lock the process address space lock.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index b41be5b8a1..294228e3e4 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -485,7 +485,7 @@ public:
ErrorOr<void> exec(NonnullOwnPtr<KString> path, Vector<NonnullOwnPtr<KString>> arguments, Vector<NonnullOwnPtr<KString>> environment, Thread*& new_main_thread, InterruptsState& previous_interrupts_state, int recursion_depth = 0);
- ErrorOr<LoadResult> load(NonnullRefPtr<OpenFileDescription> main_program_description, RefPtr<OpenFileDescription> interpreter_description, const ElfW(Ehdr) & main_program_header);
+ ErrorOr<LoadResult> load(Memory::AddressSpace& new_space, NonnullRefPtr<OpenFileDescription> main_program_description, RefPtr<OpenFileDescription> interpreter_description, const ElfW(Ehdr) & main_program_header);
void terminate_due_to_signal(u8 signal);
ErrorOr<void> send_signal(u8 signal, Process* sender);