1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

alpha: Use Linux generic sigaction implementation

Alpha rt_sigaction syscall uses a slight different kernel ABI than
generic one:

arch/alpha/kernel/signal.c

 90 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
 91                 struct sigaction __user *, oact,
 92                 size_t, sigsetsize, void __user *, restorer)

Similar as sparc, the syscall expects a restorer function.  However
different than sparc, alpha defines the restorer as the 5th argument
(sparc defines as the 4th).

This patch removes the arch-specific alpha sigaction implementation,
adapt the Linux generic one to different restore placements (through
STUB macro), and make alpha use the Linux generic kernel_sigaction
definition.

Checked on alpha-linux-gnu and x86_64-linux-gnu (for sanity).

	* sysdeps/unix/sysv/linux/alpha/Makefile: Update comment about
	__syscall_rt_sigaction.
	* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
	(kernel_sigaction): Use Linux generic defintion.
	(STUB): Define.
	(__syscall_rt_sigreturn, __syscall_sigreturn): Add prototype.
	* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
	(__syscall_rt_sigaction): Remove implementation.
	(__syscall_sigreturn, __syscall_rt_sigreturn): Define as global and
	hidden.
	* sysdeps/unix/sysv/linux/alpha/sigaction.c: Remove file.
	* sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL,
	INTERNAL_SYSCALL): Remove definitions.
	* sysdeps/unix/sysv/linux/sigaction.c: Define STUB to accept both the
	action and signal set size.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (STUB): Redefine.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (STUB): Likewise.
This commit is contained in:
Adhemerval Zanella
2018-12-11 16:57:49 -02:00
parent 43a45c2d82
commit 56b98bf1fb
9 changed files with 42 additions and 115 deletions

View File

@@ -18,43 +18,6 @@
#include <sysdep.h>
/* On Alpha we desparately want to avoid having to issue an imb. Ordinarily
the kernel would have to issue one after setting up the signal return
stack, but the Linux rt_sigaction syscall is prepared to accept a pointer
to the sigreturn syscall, instead of inlining it on the stack.
This just about halves signal delivery time. */
.text
ENTRY(__syscall_rt_sigaction)
cfi_startproc
ldgp gp,0(pv)
#ifdef PROF
.set noat
lda AT, _mcount
jsr AT, (AT), _mcount
.set at
#endif
.prologue 1
beq a1, 0f
ldl t0, 8(a1) # sa_flags
ldah a4, __syscall_sigreturn(gp) !gprelhigh
ldah t1, __syscall_rt_sigreturn(gp) !gprelhigh
lda a4, __syscall_sigreturn(a4) !gprellow
lda t1, __syscall_rt_sigreturn(t1) !gprellow
and t0, 0x40, t0 # SA_SIGINFO
cmovne t0, t1, a4
0: ldi v0, __NR_rt_sigaction
callsys
bne a3, SYSCALL_ERROR_LABEL
ret
cfi_endproc
PSEUDO_END(__syscall_rt_sigaction)
/* To enable unwinding through the signal frame without special hackery
elsewhere, describe the entire struct sigcontext with unwind info.
@@ -104,6 +67,8 @@ __syscall_sigreturn:
callsys
.size __syscall_sigreturn, .-__syscall_sigreturn
.type __syscall_sigreturn, @function
.global __syscall_sigreturn;
.hidden __syscall_sigreturn;
/* See above wrt including the nop. */
cfi_def_cfa_offset (176 + 648)
@@ -116,5 +81,7 @@ __syscall_rt_sigreturn:
callsys
.size __syscall_rt_sigreturn, .-__syscall_rt_sigreturn
.type __syscall_rt_sigreturn, @function
.global __syscall_rt_sigreturn;
.hidden __syscall_rt_sigreturn;
cfi_endproc