diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2023-01-08 16:16:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-27 11:41:43 +0100 |
commit | fb1077486217917f41c4cd47df9502b51c622799 (patch) | |
tree | f5d3c0004a966f018a276df385aa7986fa1ddcdd /Kernel/Syscall.cpp | |
parent | 247109cee67ee2103175b671e051d02b9afdd704 (diff) | |
download | serenity-fb1077486217917f41c4cd47df9502b51c622799.zip |
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.
Diffstat (limited to 'Kernel/Syscall.cpp')
-rw-r--r-- | Kernel/Syscall.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index de769c04c1..bb01695bb3 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -145,7 +145,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap) auto& regs = *trap->regs; auto* current_thread = Thread::current(); - VERIFY(current_thread->previous_mode() == Thread::PreviousMode::UserMode); + VERIFY(current_thread->previous_mode() == ExecutionMode::User); auto& process = current_thread->process(); if (process.is_dying()) { // It's possible this thread is just about to make a syscall while another is @@ -205,7 +205,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap) current_thread->check_dispatch_pending_signal(); // If the previous mode somehow changed something is seriously messed up... - VERIFY(current_thread->previous_mode() == Thread::PreviousMode::UserMode); + VERIFY(current_thread->previous_mode() == ExecutionMode::User); // Check if we're supposed to return to userspace or just die. current_thread->die_if_needed(); |