aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-04-29 14:18:40 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-06-28 04:35:27 +0530
commit189878ae237d443571250f76655161d91c018889 (patch)
tree6fbab8561b9fb431e00545b08eb6e2746ced2114
parent1b3b7693b7c3f94bd66a8425201a4bb7de5388e4 (diff)
downloadqemu-189878ae237d443571250f76655161d91c018889.zip
qemu-189878ae237d443571250f76655161d91c018889.tar.gz
qemu-189878ae237d443571250f76655161d91c018889.tar.bz2
semihosting: Use env more often in do_common_semihosting
We've already loaded cs->env_ptr into a local variable; use it. Since env is unconditionally used, we don't need a dummy use. Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--semihosting/arm-compat-semi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index 5e442e5..adb4e5b 100644
--- a/semihosting/arm-compat-semi.c
+++ b/semihosting/arm-compat-semi.c
@@ -553,7 +553,6 @@ void do_common_semihosting(CPUState *cs)
GuestFD *gf;
int64_t elapsed;
- (void) env; /* Used implicitly by arm lock_user macro */
nr = common_semi_arg(cs, 0) & 0xffffffffU;
args = common_semi_arg(cs, 1);
@@ -636,12 +635,12 @@ void do_common_semihosting(CPUState *cs)
break;
case TARGET_SYS_WRITEC:
- qemu_semihosting_console_outc(cs->env_ptr, args);
+ qemu_semihosting_console_outc(env, args);
common_semi_set_ret(cs, 0xdeadbeef);
break;
case TARGET_SYS_WRITE0:
- ret = qemu_semihosting_console_outs(cs->env_ptr, args);
+ ret = qemu_semihosting_console_outs(env, args);
common_semi_set_ret(cs, ret);
break;
@@ -672,7 +671,7 @@ void do_common_semihosting(CPUState *cs)
break;
case TARGET_SYS_READC:
- ret = qemu_semihosting_console_inc(cs->env_ptr);
+ ret = qemu_semihosting_console_inc(env);
common_semi_set_ret(cs, ret);
break;