>From 9a78a2f7f8a9063c2ef4dd9b52ffc061d045886b Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Wed, 3 Feb 2016 10:22:35 +0100 Subject: [PATCH 2/2] m68k: Build the opcode table only once to avoid multithreading issues Signed-off-by: John Paul Adrian Glaubitz --- target-m68k/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 535d7f9..015e220 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -2828,6 +2828,12 @@ register_opcode (disas_proc proc, uint16_t opcode, uint16_t mask) Later insn override earlier ones. */ void register_m68k_insns (CPUM68KState *env) { + /* Build the opcode table only once to avoid + multithreading issues. */ + if (opcode_table[0] != NULL) { + return; + } + #define INSN(name, opcode, mask, feature) do { \ if (m68k_feature(env, M68K_FEATURE_##feature)) \ register_opcode(disas_##name, 0x##opcode, 0x##mask); \ -- 2.7.0