From cfe67cef48696e8b901aff38a82056ae64d69c98 Mon Sep 17 00:00:00 2001 From: Leon Alrae Date: Fri, 19 Jun 2015 14:17:45 +0100 Subject: semihosting: create SemihostingConfig structure and semihost.h Remove semihosting_enabled and semihosting_target and replace them with SemihostingConfig structure containing equivalent fields. The structure is defined in vl.c where it is actually set. Also introduce separate header file include/exec/semihost.h allowing to access semihosting config related stuff from target specific semihosting code. Signed-off-by: Leon Alrae Reviewed-by: Peter Maydell Message-id: 1434643256-16858-2-git-send-email-leon.alrae@imgtec.com Signed-off-by: Peter Maydell --- target-m68k/op_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'target-m68k') diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c index 06661f58ca..4f8fabb922 100644 --- a/target-m68k/op_helper.c +++ b/target-m68k/op_helper.c @@ -19,6 +19,7 @@ #include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" +#include "exec/semihost.h" #if defined(CONFIG_USER_ONLY) @@ -33,8 +34,6 @@ static inline void do_interrupt_m68k_hardirq(CPUM68KState *env) #else -extern int semihosting_enabled; - /* Try to fill the TLB and return an exception if error. If retaddr is NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ @@ -85,7 +84,7 @@ static void do_interrupt_all(CPUM68KState *env, int is_hw) do_rte(env); return; case EXCP_HALT_INSN: - if (semihosting_enabled + if (semihosting_enabled() && (env->sr & SR_S) != 0 && (env->pc & 3) == 0 && cpu_lduw_code(env, env->pc - 4) == 0x4e71 -- cgit v1.2.1