alpha: use alpha_ni_syscall only for syscall zero
Once upon a time it used to have a C part that printed a warning about unimplemented OSF syscalls. That's what it's been doing all over the OSF syscall range, while the native Linux syscall range uses sys_ni_syscall(). With those warnings about unimplemented OSF syscalls gone (circa 2.4), alpha_ni_syscall() has shrunk to that little bit of asm and the only reason it hasn't been replaced with sys_ni_syscall() everywhere is that extra twist needed in case of syscall #0. Let's keep it only for syscall #0 and replace the rest with sys_ni_syscall. And use sys_ni_syscall for "number out range" in ptraced-call case, as we'd been doing for normal codepath since 2.1.86... Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -473,7 +473,7 @@ entSys:
|
||||
bne $3, strace
|
||||
beq $4, 1f
|
||||
ldq $27, 0($5)
|
||||
1: jsr $26, ($27), alpha_ni_syscall
|
||||
1: jsr $26, ($27), sys_ni_syscall
|
||||
ldgp $gp, 0($26)
|
||||
blt $0, $syscall_error /* the call failed */
|
||||
stq $0, 0($sp)
|
||||
@@ -587,7 +587,7 @@ strace:
|
||||
/* get the system call pointer.. */
|
||||
lda $1, NR_SYSCALLS($31)
|
||||
lda $2, sys_call_table
|
||||
lda $27, alpha_ni_syscall
|
||||
lda $27, sys_ni_syscall
|
||||
cmpult $0, $1, $1
|
||||
s8addq $0, $2, $2
|
||||
beq $1, 1f
|
||||
@@ -843,15 +843,20 @@ sys_rt_sigreturn:
|
||||
.end sys_rt_sigreturn
|
||||
|
||||
.align 4
|
||||
.globl alpha_ni_syscall
|
||||
.ent alpha_ni_syscall
|
||||
alpha_ni_syscall:
|
||||
.globl alpha_syscall_zero
|
||||
.ent alpha_syscall_zero
|
||||
alpha_syscall_zero:
|
||||
.prologue 0
|
||||
/* Special because it also implements overflow handling via
|
||||
syscall number 0. And if you recall, zero is a special
|
||||
trigger for "not an error". Store large non-zero there. */
|
||||
/* Special because it needs to do something opposite to
|
||||
force_successful_syscall_return(). We use the saved
|
||||
syscall number for that, zero meaning "not an error".
|
||||
That works nicely, but for real syscall 0 we need to
|
||||
make sure that this logics doesn't get confused.
|
||||
Store a non-zero there - -ENOSYS we need in register
|
||||
for our return value will do just fine.
|
||||
*/
|
||||
lda $0, -ENOSYS
|
||||
unop
|
||||
stq $0, 0($sp)
|
||||
ret
|
||||
.end alpha_ni_syscall
|
||||
.end alpha_syscall_zero
|
||||
|
Reference in New Issue
Block a user