Skip to content

Commit

Permalink
target/m68k: Fix semihost lseek offset computation
Browse files Browse the repository at this point in the history
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.

Cc: qemu-stable@nongnu.org
Fixes: 9502725 ("target/m68k: Use semihosting/syscalls.h")
Reported-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230801154519.3505531-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit 8caaae7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
pm215 authored and Michael Tokarev committed Aug 4, 2023
1 parent 3d81ba8 commit 71e05c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/m68k/m68k-semi.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
GET_ARG64(2);
GET_ARG64(3);
semihost_sys_lseek(cs, m68k_semi_u64_cb, arg0,
deposit64(arg2, arg1, 32, 32), arg3);
deposit64(arg2, 32, 32, arg1), arg3);
break;

case HOSTED_RENAME:
Expand Down

0 comments on commit 71e05c4

Please sign in to comment.