Kernel: Remove is_in_syscall from Thread

This commit is contained in:
Bananymous 2023-07-30 14:49:51 +03:00
parent 5e434f5131
commit 6f7d97cf94
4 changed files with 1 additions and 9 deletions

View File

@ -161,7 +161,7 @@ namespace IDT
Kernel::Thread::current().set_return_rip(interrupt_stack.rip);
}
if (tid && Kernel::Thread::current().is_userspace() && !Kernel::Thread::current().is_in_syscall())
if (tid && Kernel::Thread::current().is_userspace())
{
// TODO: Confirm and fix the exception to signal mappings

View File

@ -80,10 +80,7 @@ namespace Kernel
Process& process();
bool has_process() const { return m_process; }
void set_in_syscall(bool b) { m_in_syscall = b; }
bool is_userspace() const { return m_is_userspace; }
bool is_in_syscall() const { return m_in_syscall; }
private:
Thread(pid_t tid, Process*);
@ -102,7 +99,6 @@ namespace Kernel
const pid_t m_tid { 0 };
State m_state { State::NotStarted };
Process* m_process { nullptr };
bool m_in_syscall { false };
bool m_is_userspace { false };
uintptr_t* m_return_rsp { nullptr };

View File

@ -20,7 +20,6 @@ namespace Kernel
extern "C" long cpp_syscall_handler(int syscall, uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, InterruptStack& interrupt_stack)
{
Thread::current().set_in_syscall(true);
Thread::current().set_return_rsp(interrupt_stack.rsp);
Thread::current().set_return_rip(interrupt_stack.rip);
@ -173,8 +172,6 @@ namespace Kernel
asm volatile("cli");
Thread::current().set_in_syscall(false);
if (ret.is_error())
return -ret.error().get_error_code();
return ret.value();

View File

@ -153,7 +153,6 @@ namespace Kernel
thread->m_stack = TRY(m_stack->clone(new_process->page_table()));
thread->m_state = State::Executing;
thread->m_in_syscall = true;
thread->m_rip = rip;
thread->m_rsp = rsp;