On 22 June 2016 at 01:32, Richard Henderson <r...@twiddle.net> wrote: > Signed-off-by: Richard Henderson <r...@twiddle.net> > --- > linux-user/host/aarch64/hostdep.h | 23 +++++++++ > linux-user/host/aarch64/safe-syscall.inc.S | 75 > ++++++++++++++++++++++++++++++ > 2 files changed, 98 insertions(+) > create mode 100644 linux-user/host/aarch64/safe-syscall.inc.S
> +safe_syscall_base: > + .cfi_startproc > + /* The syscall calling convention isn't the same as the > + * C one: > + * we enter with x0 == *signal_pending > + * x1 == syscall number > + * x2 ... x7, (stack) == syscall arguments > + * and return the result in x0 > + * and the syscall instruction needs > + * x8 == syscall number > + * x0 ... x6 == syscall arguments > + * and returns the result in x0 > + * Shuffle everything around appropriately. > + */ > + mov x9, x0 /* signal_pending pointer */ > + mov x8, x1 /* syscall number */ > + mov x0, x2 /* syscall arguments */ > + mov x1, x3 > + mov x2, x4 > + mov x3, x5 > + mov x4, x6 > + mov x6, x7 > + ldr x7, [sp] Comment says "x0 ... x6 == syscall arguments" but the code loads x7 too. Otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM