Re: [Qemu-devel] [PATCH 4/9] target-arm/arm-semi.c: Factor out repeated 'return env-regs[0]'

2015-08-19 Thread Christopher Covington
On Thu, Aug 13, 2015 at 9:35 AM, Peter Maydell peter.mayd...@linaro.org wrote: Factor out a repeated pattern in the semihosting code: gdb_do_syscall(arm_semi_cb, system,%s, arg0, (int)arg1+1); /* arm_semi_cb sets env-regs[0] to the syscall return value */ return env-regs[0]; For

[Qemu-devel] [PATCH 4/9] target-arm/arm-semi.c: Factor out repeated 'return env-regs[0]'

2015-08-13 Thread Peter Maydell
Factor out a repeated pattern in the semihosting code: gdb_do_syscall(arm_semi_cb, system,%s, arg0, (int)arg1+1); /* arm_semi_cb sets env-regs[0] to the syscall return value */ return env-regs[0]; For A64 the return value will go in a different register; pull the sequence out into