Kernel: Factor our PreviousMode into RegisterState::previous_mode

Various places in the kernel were manually checking the cs register for
x86_64, however to share this with aarch64 a function in RegisterState
is added, and the call-sites are updated. While we're here the
PreviousMode enum is renamed to ExecutionMode.
This commit is contained in:
Timon Kruiper 2023-01-08 16:16:08 +01:00 committed by Andreas Kling
parent 247109cee6
commit fb10774862
Notes: sideshowbarker 2024-07-17 07:14:09 +09:00
11 changed files with 53 additions and 29 deletions

View file

@ -14,7 +14,7 @@ namespace Kernel {
void Process::sys$exit(int status)
{
// FIXME: We have callers from kernel which don't acquire the big process lock.
if (Thread::current()->previous_mode() == Thread::PreviousMode::UserMode) {
if (Thread::current()->previous_mode() == ExecutionMode::User) {
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
}