From: Keith Packard Date: Mon, 31 Jul 2023 23:52:45 +0000 (-0700) Subject: target/nios2: Fix semihost lseek offset computation X-Git-Tag: qemu-xen-4.18.0-rc5~23 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3d81ba8da4e7979fbcafca7a3e4fbda4dd53adbd;p=qemu-xen.git target/nios2: Fix semihost lseek offset computation The arguments for deposit64 are (value, start, length, fieldval); this appears to have thought they were (value, fieldval, start, length). Reorder the parameters to match the actual function. Signed-off-by: Keith Packard Reviewed-by: Philippe Mathieu-Daudé Fixes: d1e23cbaa403b2d ("target/nios2: Use semihosting/syscalls.h") Reviewed-by: Peter Maydell Message-Id: <20230731235245.295513-1-keithp@keithp.com> Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit 71e2dd6aa1bdbac19c661638a4ae91816002ac9e) Signed-off-by: Michael Tokarev --- diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index f3b7aee4f1..9d0241c758 100644 --- a/target/nios2/nios2-semi.c +++ b/target/nios2/nios2-semi.c @@ -169,7 +169,7 @@ void do_nios2_semihosting(CPUNios2State *env) GET_ARG64(2); GET_ARG64(3); semihost_sys_lseek(cs, nios2_semi_u64_cb, arg0, - deposit64(arg2, arg1, 32, 32), arg3); + deposit64(arg2, 32, 32, arg1), arg3); break; case HOSTED_RENAME: