From f1672e6f2b6642f9bf5042df6713ce8e4a0f00c6 Mon Sep 17 00:00:00 2001 From: Alex Bennée Date: Mon, 13 May 2019 14:43:57 +0100 Subject: semihosting: move semihosting configuration into its own directory In preparation for having some more common semihosting code let's excise the current config magic from vl.c into its own file. We shall later add more conditionals to the build configurations so we can avoid building this if we don't need it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/mips/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/mips/translate.c') diff --git a/target/mips/translate.c b/target/mips/translate.c index f96c0d01ef..3cd5b11b16 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -32,7 +32,7 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "exec/semihost.h" +#include "hw/semihosting/semihost.h" #include "target/mips/trace.h" #include "trace-tcg.h" -- cgit v1.2.3-55-g7522 From 82ba42666c5bb00438e96f4ec9c8a9206e1b02dd Mon Sep 17 00:00:00 2001 From: Alex Bennée Date: Tue, 14 May 2019 13:50:45 +0100 Subject: target/mips: only build mips-semi for softmmu The is_uhi gates all semihosting calls and always returns false for CONFIG_USER_ONLY builds. There is no reason to build and link mips-semi for these builds so lets fix that. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic Reviewed-by: Richard Henderson --- target/mips/Makefile.objs | 3 ++- target/mips/helper.h | 2 ++ target/mips/translate.c | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'target/mips/translate.c') diff --git a/target/mips/Makefile.objs b/target/mips/Makefile.objs index 651f36f517..3448ad5e19 100644 --- a/target/mips/Makefile.objs +++ b/target/mips/Makefile.objs @@ -1,4 +1,5 @@ obj-y += translate.o dsp_helper.o op_helper.o lmi_helper.o helper.o cpu.o -obj-y += gdbstub.o msa_helper.o mips-semi.o +obj-y += gdbstub.o msa_helper.o +obj-$(CONFIG_SOFTMMU) += mips-semi.o obj-$(CONFIG_SOFTMMU) += machine.o cp0_timer.o obj-$(CONFIG_KVM) += kvm.o diff --git a/target/mips/helper.h b/target/mips/helper.h index a6d687e340..90ab03b76e 100644 --- a/target/mips/helper.h +++ b/target/mips/helper.h @@ -2,7 +2,9 @@ DEF_HELPER_3(raise_exception_err, noreturn, env, i32, int) DEF_HELPER_2(raise_exception, noreturn, env, i32) DEF_HELPER_1(raise_exception_debug, noreturn, env) +#ifndef CONFIG_USER_ONLY DEF_HELPER_1(do_semihosting, void, env) +#endif #ifdef TARGET_MIPS64 DEF_HELPER_4(sdl, void, env, tl, tl, int) diff --git a/target/mips/translate.c b/target/mips/translate.c index 3cd5b11b16..fb905c88b5 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -13726,6 +13726,14 @@ static inline bool is_uhi(int sdbbp_code) #endif } +#ifdef CONFIG_USER_ONLY +/* The above should dead-code away any calls to this..*/ +static inline void gen_helper_do_semihosting(void *env) +{ + g_assert_not_reached(); +} +#endif + static int decode_mips16_opc (CPUMIPSState *env, DisasContext *ctx) { int rx, ry; -- cgit v1.2.3-55-g7522