This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/6] aarch64: Improve sysdep-cancel.h


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]