Page MenuHomeFreeBSD

linux: Fix declaration of rt_sigreturn()
ClosedPublic

Authored by trasz on Tue, Jul 20, 7:45 PM.

Details

Summary

On Linux, this syscall doesn't take any arguments; instead,
it assumes the context was put on the stack.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

trasz requested review of this revision.Tue, Jul 20, 7:45 PM

The change is trivial, but I'd like to make sure I got this right; I have a patch that implements signal delivery on arm64, but it's still somewhat buggy. I'm not sure where the argument got here in the first place.

The Linux implementation can be found here: https://elixir.bootlin.com/linux/latest/source/arch/arm64/kernel/signal.c

I'm not sure where the argument got here in the first place.

I assume it's here copied from amd64

I think you should start by adapting arm64 sendsig and sigreturn, and trampoline

This comment was removed by trasz.

as sigreturn called only from trampolines so it decl depends on how trampoline call it

I think you should start by adapting arm64 sendsig and sigreturn, and trampoline

That’s precisely what I’ve done, except that I stole the trampoline from Linux. It’s three instructions, and I’d rather not diverge here, to avoid complicating matters for native Linux debuggers or unwinders.

I think you should start by adapting arm64 sendsig and sigreturn, and trampoline

That’s precisely what I’ve done, except that I stole the trampoline from Linux. It’s three instructions, and I’d rather not diverge here, to avoid complicating matters for native Linux debuggers or unwinders.

ah, I read comments of Linux arm64 sigreturn about unwinding))
so, you are on a right direction, as arm64 unwinders depends on the sigreturn instruction sequence.

This revision is now accepted and ready to land.Tue, Jul 20, 9:29 PM