From fe2e25edad8c2c9ee1b071fc8ef6cd0f8584d0b5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 7 Sep 2021 01:32:54 +0200 Subject: [PATCH] Kernel: Add a comment explaining an alternate path in Process::exec() I had to look at this for a moment before I realized that sys$execve() and the spawning of /bin/SystemServer at boot are taking two different paths out of exec(). Add a comment to help the next person looking at it. :^) --- Kernel/Syscalls/execve.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index 8c72528cfa..5dbe3dfc5e 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -848,6 +848,9 @@ KResult Process::exec(String path, Vector arguments, Vector envi VERIFY_NOT_REACHED(); } + // NOTE: This code path is taken in the non-syscall case, i.e when the kernel spawns + // a userspace process directly (such as /bin/SystemServer on startup) + if (prev_flags & 0x200) sti(); Processor::leave_critical();