summaryrefslogtreecommitdiffstats
path: root/qemu/target-sh4/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/target-sh4/cpu.c')
-rw-r--r--qemu/target-sh4/cpu.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/qemu/target-sh4/cpu.c b/qemu/target-sh4/cpu.c
index 5c65ab4df..86ba38808 100644
--- a/qemu/target-sh4/cpu.c
+++ b/qemu/target-sh4/cpu.c
@@ -19,6 +19,8 @@
* <http://www.gnu.org/licenses/lgpl-2.1.html>
*/
+#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "cpu.h"
#include "qemu-common.h"
#include "migration/vmstate.h"
@@ -70,6 +72,12 @@ static void superh_cpu_reset(CPUState *s)
set_default_nan_mode(1, &env->fp_status);
}
+static void superh_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
+{
+ info->mach = bfd_mach_sh4;
+ info->print_insn = print_insn_sh;
+}
+
typedef struct SuperHCPUListState {
fprintf_function cpu_fprintf;
FILE *file;
@@ -288,8 +296,18 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data)
#else
cc->get_phys_page_debug = superh_cpu_get_phys_page_debug;
#endif
- dc->vmsd = &vmstate_sh_cpu;
+ cc->disas_set_info = superh_cpu_disas_set_info;
+
cc->gdb_num_core_regs = 59;
+
+ dc->vmsd = &vmstate_sh_cpu;
+
+ /*
+ * Reason: superh_cpu_initfn() calls cpu_exec_init(), which saves
+ * the object in cpus -> dangling pointer after final
+ * object_unref().
+ */
+ dc->cannot_destroy_with_object_finalize_yet = true;
}
static const TypeInfo superh_cpu_type_info = {