Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 <keithp@keithp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Fixes: d1e23cb ("target/nios2: Use semihosting/syscalls.h")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230731235245.295513-1-keithp@keithp.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
keith-packard authored and philmd committed Aug 1, 2023
1 parent c11d5bd commit 71e2dd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/nios2/nios2-semi.c
Expand Up @@ -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:
Expand Down

0 comments on commit 71e2dd6

Please sign in to comment.