mirror of git://sourceware.org/git/glibc.git
aarch64: Tidy syscall error check
Move the error branch from the PSEUDO_RET macro to the PSEUDO macro. This is in line with other architectures, and will enable further improvments.
This commit is contained in:
parent
6e6c2d01eb
commit
ca3cfa40c1
|
@ -1,5 +1,13 @@
|
||||||
2014-05-25 Richard Henderson <rth@twiddle.net>
|
2014-05-25 Richard Henderson <rth@twiddle.net>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/aarch64/sysdep.h (PSEUDO_RET): Move
|
||||||
|
branch to syscall error ...
|
||||||
|
(PSEUDO): ... here.
|
||||||
|
[NOT_IN_libc] (SYSCALL_ERROR_HANDLER): Rename the label
|
||||||
|
from __local_syscall_error to .Lsyscall_error.
|
||||||
|
[!NOT_IN_libc] (SYSCALL_ERROR_HANDLER): Branch to __syscall_error.
|
||||||
|
(SYSCALL_ERROR): Update label name.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
|
* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
|
||||||
Do not use DOARGS/UNDOARGS.
|
Do not use DOARGS/UNDOARGS.
|
||||||
* sysdeps/unix/sysv/linux/aarch64/sysdep.h (DO_CALL): Likewise.
|
* sysdeps/unix/sysv/linux/aarch64/sysdep.h (DO_CALL): Likewise.
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
cfi_startproc; \
|
cfi_startproc; \
|
||||||
DO_CALL (syscall_name, args); \
|
DO_CALL (syscall_name, args); \
|
||||||
cmn x0, 4095; \
|
cmn x0, 4095; \
|
||||||
|
b.cs .Lsyscall_error; \
|
||||||
PSEUDO_RET; \
|
PSEUDO_RET; \
|
||||||
cfi_endproc; \
|
cfi_endproc; \
|
||||||
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
||||||
|
@ -41,6 +42,7 @@
|
||||||
bne .Lpseudo_cancel; \
|
bne .Lpseudo_cancel; \
|
||||||
DO_CALL (syscall_name, 0); \
|
DO_CALL (syscall_name, 0); \
|
||||||
cmn x0, 4095; \
|
cmn x0, 4095; \
|
||||||
|
b.cs .Lsyscall_error; \
|
||||||
PSEUDO_RET; \
|
PSEUDO_RET; \
|
||||||
.Lpseudo_cancel: \
|
.Lpseudo_cancel: \
|
||||||
DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
|
DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
|
||||||
|
@ -58,7 +60,8 @@
|
||||||
ldr x30, [sp], 16; \
|
ldr x30, [sp], 16; \
|
||||||
cfi_adjust_cfa_offset (-16); \
|
cfi_adjust_cfa_offset (-16); \
|
||||||
cfi_restore (x30); \
|
cfi_restore (x30); \
|
||||||
cmn x0, 4095;
|
cmn x0, 4095; \
|
||||||
|
b.cs .Lsyscall_error;
|
||||||
|
|
||||||
# define DOCARGS_0 \
|
# define DOCARGS_0 \
|
||||||
str x30, [sp, -16]!; \
|
str x30, [sp, -16]!; \
|
||||||
|
|
|
@ -58,17 +58,15 @@
|
||||||
.text; \
|
.text; \
|
||||||
ENTRY (name); \
|
ENTRY (name); \
|
||||||
DO_CALL (syscall_name, args); \
|
DO_CALL (syscall_name, args); \
|
||||||
cmn x0, #4095;
|
cmn x0, #4095; \
|
||||||
|
b.cs .Lsyscall_error;
|
||||||
|
|
||||||
/* Notice the use of 'RET' instead of 'ret' the assembler is case
|
/* Notice the use of 'RET' instead of 'ret' the assembler is case
|
||||||
insensitive and eglibc already uses the preprocessor symbol 'ret'
|
insensitive and eglibc already uses the preprocessor symbol 'ret'
|
||||||
so we use the upper case 'RET' to force through a ret instruction
|
so we use the upper case 'RET' to force through a ret instruction
|
||||||
to the assembler */
|
to the assembler */
|
||||||
# define PSEUDO_RET \
|
# define PSEUDO_RET \
|
||||||
b.cs 1f; \
|
RET;
|
||||||
RET; \
|
|
||||||
1: \
|
|
||||||
b SYSCALL_ERROR
|
|
||||||
# undef ret
|
# undef ret
|
||||||
# define ret PSEUDO_RET
|
# define ret PSEUDO_RET
|
||||||
|
|
||||||
|
@ -112,10 +110,10 @@
|
||||||
# define ret_ERRVAL PSEUDO_RET_NOERRNO
|
# define ret_ERRVAL PSEUDO_RET_NOERRNO
|
||||||
|
|
||||||
# if NOT_IN_libc
|
# if NOT_IN_libc
|
||||||
# define SYSCALL_ERROR __local_syscall_error
|
# define SYSCALL_ERROR .Lsyscall_error
|
||||||
# if RTLD_PRIVATE_ERRNO
|
# if RTLD_PRIVATE_ERRNO
|
||||||
# define SYSCALL_ERROR_HANDLER \
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
__local_syscall_error: \
|
.Lsyscall_error: \
|
||||||
adrp x1, C_SYMBOL_NAME(rtld_errno); \
|
adrp x1, C_SYMBOL_NAME(rtld_errno); \
|
||||||
neg w0, w0; \
|
neg w0, w0; \
|
||||||
str w0, [x1, :lo12:C_SYMBOL_NAME(rtld_errno)]; \
|
str w0, [x1, :lo12:C_SYMBOL_NAME(rtld_errno)]; \
|
||||||
|
@ -124,7 +122,7 @@ __local_syscall_error: \
|
||||||
# else
|
# else
|
||||||
|
|
||||||
# define SYSCALL_ERROR_HANDLER \
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
__local_syscall_error: \
|
.Lsyscall_error: \
|
||||||
stp x29, x30, [sp, -32]!; \
|
stp x29, x30, [sp, -32]!; \
|
||||||
cfi_adjust_cfa_offset (32); \
|
cfi_adjust_cfa_offset (32); \
|
||||||
cfi_rel_offset (x29, 0); \
|
cfi_rel_offset (x29, 0); \
|
||||||
|
@ -143,8 +141,10 @@ __local_syscall_error: \
|
||||||
RET;
|
RET;
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
|
|
||||||
# define SYSCALL_ERROR __syscall_error
|
# define SYSCALL_ERROR __syscall_error
|
||||||
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
|
.Lsyscall_error: \
|
||||||
|
b __syscall_error;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Linux takes system call args in registers:
|
/* Linux takes system call args in registers:
|
||||||
|
|
Loading…
Reference in New Issue