Instead of using R_ARG0 (the semihost function number), use R_ARG1
(the provided exit status).
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <
20230801152245.332749-1-keithp@keithp.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
args = env->regs[R_ARG1];
switch (nr) {
case HOSTED_EXIT:
- gdb_exit(env->regs[R_ARG0]);
- exit(env->regs[R_ARG0]);
+ gdb_exit(env->regs[R_ARG1]);
+ exit(env->regs[R_ARG1]);
case HOSTED_OPEN:
GET_ARG(0);