diff options
author | Richard Henderson <rth@redhat.com> | 2014-05-25 14:07:17 -0400 |
---|---|---|
committer | Will Newton <will.newton@linaro.org> | 2014-07-03 15:08:46 +0100 |
commit | 9c7dad51d404f38624d8a4301646dde981a285f5 (patch) | |
tree | 80d7a8986f484bb91df053266fb8f66e2ff1e490 | |
parent | aed06e6b9b1c8af4b83eda864bf615df8b5315b7 (diff) |
aarch64: Share code in syscall-cancel.h
Fold nocancel and error handling paths.
-rw-r--r-- | libc/ports/ChangeLog.aarch64.linaro | 5 | ||||
-rw-r--r-- | libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 28 |
2 files changed, 19 insertions, 14 deletions
diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro index 582fb54bb..4730abda5 100644 --- a/libc/ports/ChangeLog.aarch64.linaro +++ b/libc/ports/ChangeLog.aarch64.linaro @@ -1,5 +1,10 @@ 2014-05-29 Richard Henderson <rth@twiddle.net> + * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO): + Use ENTRY to define the _nocancel entry point. Share the syscall + and syscall error check paths with the cancel path. + (PSEUDO_END): New. + * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h: Adjust whitespace; tabs before and after asm mnemonics. diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h index 26d4c0ec8..41502de60 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h +++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h @@ -27,24 +27,17 @@ # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ .section ".text"; \ - .type __##syscall_name##_nocancel,%function; \ - .globl __##syscall_name##_nocancel; \ -__##syscall_name##_nocancel: \ - cfi_startproc; \ +ENTRY (__##syscall_name##_nocancel); \ +.Lpseudo_nocancel: \ DO_CALL (syscall_name, args); \ +.Lpseudo_finish: \ cmn x0, 4095; \ b.cs .Lsyscall_error; \ - PSEUDO_RET; \ - cfi_endproc; \ + .subsection 2; \ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ ENTRY (name); \ SINGLE_THREAD_P; \ - bne .Lpseudo_cancel; \ - DO_CALL (syscall_name, 0); \ - cmn x0, 4095; \ - b.cs .Lsyscall_error; \ - PSEUDO_RET; \ -.Lpseudo_cancel: \ + beq .Lpseudo_nocancel; \ DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \ CENABLE; \ mov x16, x0; /* put mask in safe place. */ \ @@ -60,8 +53,15 @@ ENTRY (name); \ ldr x30, [sp], 16; \ cfi_adjust_cfa_offset (-16); \ cfi_restore (x30); \ - cmn x0, 4095; \ - b.cs .Lsyscall_error; + b .Lpseudo_finish; \ + cfi_endproc; \ + .size name, .-name; \ + .previous + +# undef PSEUDO_END +# define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER; \ + cfi_endproc # define DOCARGS_0 \ str x30, [sp, -16]!; \ |