aboutsummaryrefslogtreecommitdiff
path: root/target-m68k/translate.c
diff options
context:
space:
mode:
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>2016-02-03 10:22:35 +0100
committerLaurent Vivier <laurent@vivier.eu>2016-10-25 20:54:47 +0200
commitb208525797b031c1be4121553e21746686318a38 (patch)
tree29f27ba942a7421722b1487d42126e0c38d7b8b4 /target-m68k/translate.c
parenta1ff19302007986fa081738e88905a715bd68e2e (diff)
downloadqemu-b208525797b031c1be4121553e21746686318a38.zip
qemu-b208525797b031c1be4121553e21746686318a38.tar.gz
qemu-b208525797b031c1be4121553e21746686318a38.tar.bz2
target-m68k: Build the opcode table only once to avoid multithreading issues
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-m68k/translate.c')
-rw-r--r--target-m68k/translate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index deb5a58..eecb32b 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -2841,6 +2841,11 @@ 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); \