kernel: Move the signal handling logic to after a syscall sets its return value

When a signal was caught after a syscall, it was doing so without preserving the return value of the syscall.
This commit is contained in:
apio 2023-07-12 13:34:30 +02:00
parent 1091798195
commit d27ffce5db
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 1 additions and 2 deletions

View File

@ -186,6 +186,7 @@ extern "C" void arch_interrupt_entry(Registers* regs)
{
SyscallArgs args = { regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9 };
regs->rax = (u64)invoke_syscall(regs, args, regs->rax);
Scheduler::current()->process_pending_signals(regs);
}
else
{

View File

@ -15,8 +15,6 @@ i64 invoke_syscall(Registers* regs, SyscallArgs args, u64 syscall)
auto rc = syscalls[syscall](regs, args);
Scheduler::current()->process_pending_signals(regs);
if (rc.has_error()) return -rc.error();
return (i64)rc.value();
}