[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] target/m68k: Pass semihosting arg to exit
From: |
Peter Maydell |
Subject: |
Re: [PATCH 1/3] target/m68k: Pass semihosting arg to exit |
Date: |
Thu, 3 Aug 2023 11:07:44 +0100 |
On Wed, 2 Aug 2023 at 17:20, Keith Packard via <qemu-devel@nongnu.org> wrote:
>
> Instead of using d0 (the semihost function number), use d1 (the
> provide exit status).
>
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
> target/m68k/m68k-semi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
> index 88ad9ba814..12235759c7 100644
> --- a/target/m68k/m68k-semi.c
> +++ b/target/m68k/m68k-semi.c
> @@ -130,8 +130,8 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
> args = env->dregs[1];
> switch (nr) {
> case HOSTED_EXIT:
> - gdb_exit(env->dregs[0]);
> - exit(env->dregs[0]);
> + gdb_exit(env->dregs[1]);
> + exit(env->dregs[1]);
I looked at this code but didn't spot the bug, because I
got confused by the 'args = env->dregs[1]' line above somehow.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM