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:
parent
1091798195
commit
d27ffce5db
@ -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 };
|
SyscallArgs args = { regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9 };
|
||||||
regs->rax = (u64)invoke_syscall(regs, args, regs->rax);
|
regs->rax = (u64)invoke_syscall(regs, args, regs->rax);
|
||||||
|
Scheduler::current()->process_pending_signals(regs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -15,8 +15,6 @@ i64 invoke_syscall(Registers* regs, SyscallArgs args, u64 syscall)
|
|||||||
|
|
||||||
auto rc = syscalls[syscall](regs, args);
|
auto rc = syscalls[syscall](regs, args);
|
||||||
|
|
||||||
Scheduler::current()->process_pending_signals(regs);
|
|
||||||
|
|
||||||
if (rc.has_error()) return -rc.error();
|
if (rc.has_error()) return -rc.error();
|
||||||
return (i64)rc.value();
|
return (i64)rc.value();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user