This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/6] aarch64: Improve sysdep-cancel.h
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Cc: marcus dot shawcroft at gmail dot com, Richard Henderson <rth at redhat dot com>
- Date: Wed, 21 May 2014 08:10:23 -0700
- Subject: Re: [PATCH 4/6] aarch64: Improve sysdep-cancel.h
- Authentication-results: sourceware.org; auth=none
- References: <1400619378-7262-1-git-send-email-rth at twiddle dot net> <1400619378-7262-5-git-send-email-rth at twiddle dot net>
On 05/20/2014 01:56 PM, Richard Henderson wrote:
> - mov x16, x0; /* put mask in safe place. */ \
> - UNDOCARGS_##args; /* restore syscall args. */ \
> - mov x8, SYS_ify (syscall_name); /* do the call. */ \
> - svc 0; \
> - str x0, [sp, -16]!; /* save syscall return value. */ \
> - cfi_adjust_cfa_offset (16); \
> - mov x0, x16; /* get mask back. */ \
Oh, I should have mentioned, that there's either a bug or inconsistency here.
We're saving a value in x16 around the syscall. Except that on the C side, for
the inline syscalls, we mark x16 as clobbered.
My patch assumes that we want to assume "normal-ish" calling conventions for
the kernel and puts the value in the normal call saved register x19.
If there are in fact a set of calling-convention call-clobbered registers that
are not clobbered by syscalls, then we should consider adjusting the inline
syscalls to match.
r~