aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/m68k/Makefile.objs1
-rw-r--r--target/m68k/cpu.h2
-rw-r--r--target/m68k/monitor.c39
-rw-r--r--target/m68k/translate.c11
4 files changed, 42 insertions, 11 deletions
diff --git a/target/m68k/Makefile.objs b/target/m68k/Makefile.objs
index 39141ab..d143f20 100644
--- a/target/m68k/Makefile.objs
+++ b/target/m68k/Makefile.objs
@@ -1,3 +1,4 @@
obj-y += m68k-semi.o
obj-y += translate.o op_helper.o helper.o cpu.o fpu_helper.o
obj-y += gdbstub.o
+obj-$(CONFIG_SOFTMMU) += monitor.o
diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index afae5f6..5d03764 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -182,7 +182,7 @@ void cpu_m68k_set_fpcr(CPUM68KState *env, uint32_t val);
*/
typedef enum {
/* Translator only -- use env->cc_op. */
- CC_OP_DYNAMIC = -1,
+ CC_OP_DYNAMIC,
/* Each flag bit computed into cc_[xcnvz]. */
CC_OP_FLAGS,
diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c
new file mode 100644
index 0000000..5605323
--- /dev/null
+++ b/target/m68k/monitor.c
@@ -0,0 +1,39 @@
+/*
+ * QEMU monitor for m68k
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "monitor/hmp-target.h"
+
+static const MonitorDef monitor_defs[] = {
+ { "d0", offsetof(CPUM68KState, dregs[0]) },
+ { "d1", offsetof(CPUM68KState, dregs[1]) },
+ { "d2", offsetof(CPUM68KState, dregs[2]) },
+ { "d3", offsetof(CPUM68KState, dregs[3]) },
+ { "d4", offsetof(CPUM68KState, dregs[4]) },
+ { "d5", offsetof(CPUM68KState, dregs[5]) },
+ { "d6", offsetof(CPUM68KState, dregs[6]) },
+ { "d7", offsetof(CPUM68KState, dregs[7]) },
+ { "a0", offsetof(CPUM68KState, aregs[0]) },
+ { "a1", offsetof(CPUM68KState, aregs[1]) },
+ { "a2", offsetof(CPUM68KState, aregs[2]) },
+ { "a3", offsetof(CPUM68KState, aregs[3]) },
+ { "a4", offsetof(CPUM68KState, aregs[4]) },
+ { "a5", offsetof(CPUM68KState, aregs[5]) },
+ { "a6", offsetof(CPUM68KState, aregs[6]) },
+ { "a7", offsetof(CPUM68KState, aregs[7]) },
+ { "pc", offsetof(CPUM68KState, pc) },
+ { "sr", offsetof(CPUM68KState, sr) },
+ { "ssp", offsetof(CPUM68KState, sp[0]) },
+ { "usp", offsetof(CPUM68KState, sp[1]) },
+ { NULL },
+};
+
+const MonitorDef *target_monitor_defs(void)
+{
+ return monitor_defs;
+}
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index b609092..bbda739 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -181,11 +181,6 @@ static void do_writebacks(DisasContext *s)
#define IS_USER(s) s->user
#endif
-/* XXX: move that elsewhere */
-/* ??? Fix exceptions. */
-static void *gen_throws_exception;
-#define gen_last_qop NULL
-
typedef void (*disas_proc)(CPUM68KState *env, DisasContext *s, uint16_t insn);
#ifdef DEBUG_DISPATCH
@@ -207,6 +202,7 @@ typedef void (*disas_proc)(CPUM68KState *env, DisasContext *s, uint16_t insn);
#endif
static const uint8_t cc_op_live[CC_OP_NB] = {
+ [CC_OP_DYNAMIC] = CCF_C | CCF_V | CCF_Z | CCF_N | CCF_X,
[CC_OP_FLAGS] = CCF_C | CCF_V | CCF_Z | CCF_N | CCF_X,
[CC_OP_ADDB ... CC_OP_ADDL] = CCF_X | CCF_N | CCF_V,
[CC_OP_SUBB ... CC_OP_SUBL] = CCF_X | CCF_N | CCF_V,
@@ -310,7 +306,6 @@ static inline TCGv gen_load(DisasContext * s, int opsize, TCGv addr, int sign)
default:
g_assert_not_reached();
}
- gen_throws_exception = gen_last_qop;
return tmp;
}
@@ -331,7 +326,6 @@ static inline void gen_store(DisasContext *s, int opsize, TCGv addr, TCGv val)
default:
g_assert_not_reached();
}
- gen_throws_exception = gen_last_qop;
}
typedef enum {
@@ -1001,7 +995,6 @@ static void gen_load_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp)
}
tcg_temp_free(tmp);
tcg_temp_free_i64(t64);
- gen_throws_exception = gen_last_qop;
}
static void gen_store_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp)
@@ -1056,7 +1049,6 @@ static void gen_store_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp)
}
tcg_temp_free(tmp);
tcg_temp_free_i64(t64);
- gen_throws_exception = gen_last_qop;
}
static void gen_ldst_fp(DisasContext *s, int opsize, TCGv addr,
@@ -5561,7 +5553,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
gen_tb_start(tb);
do {
pc_offset = dc->pc - pc_start;
- gen_throws_exception = NULL;
tcg_gen_insn_start(dc->pc, dc->cc_op);
num_insns++;