target-m68k: Build the opcode table only once to avoid multithreading issues

Backports commit b208525797b031c1be4121553e21746686318a38 from qemu
This commit is contained in:
John Paul Adrian Glaubitz 2018-02-27 08:08:19 -05:00 committed by Lioncash
parent fd84549b3e
commit 2fd7779aa5
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

View File

@ -2906,6 +2906,13 @@ register_opcode(TCGContext *tcg_ctx, disas_proc proc, uint16_t opcode, uint16_t
void register_m68k_insns (CPUM68KState *env)
{
TCGContext *tcg_ctx = env->uc->tcg_ctx;
/* Build the opcode table only once to avoid
multithreading issues. */
if (tcg_ctx->opcode_table[0] != NULL) {
return;
}
#define INSN(name, opcode, mask, feature) do { \
if (m68k_feature(env, M68K_FEATURE_##feature)) \
register_opcode(tcg_ctx, disas_##name, 0x##opcode, 0x##mask); \