summaryrefslogtreecommitdiffstats
path: root/target/moxie/translate.c
diff options
context:
space:
mode:
authorEmilio G. Cota2017-07-19 02:46:52 +0200
committerRichard Henderson2017-10-24 22:53:41 +0200
commitc5a49c63fa26e8825ad101dfe86339ae4c216539 (patch)
treec41e1a7064e88f65292a3b09684123f9f499617e /target/moxie/translate.c
parenttcg: Include CF_COUNT_MASK in CF_HASH_MASK (diff)
downloadqemu-c5a49c63fa26e8825ad101dfe86339ae4c216539.tar.gz
qemu-c5a49c63fa26e8825ad101dfe86339ae4c216539.tar.xz
qemu-c5a49c63fa26e8825ad101dfe86339ae4c216539.zip
tcg: convert tb->cflags reads to tb_cflags(tb)
Convert all existing readers of tb->cflags to tb_cflags, so that we use atomic_read and therefore avoid undefined behaviour in C11. Note that the remaining setters/getters of the field are protected by tb_lock, and therefore do not need conversion. Luckily all readers access the field via 'tb->cflags' (so no foo.cflags, bar->cflags in the code base), which makes the conversion easily scriptable: FILES=$(git grep 'tb->cflags' target include/exec/gen-icount.h \ accel/tcg/translator.c | cut -f1 -d':' | sort | uniq) perl -pi -e 's/([^.>])tb->cflags/$1tb_cflags(tb)/g' $FILES perl -pi -e 's/([a-z->.]*)(->|\.)tb->cflags/tb_cflags($1$2tb)/g' $FILES Then manually fixed the few errors that checkpatch reported. Compile-tested for all targets. Suggested-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/moxie/translate.c')
-rw-r--r--target/moxie/translate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/moxie/translate.c b/target/moxie/translate.c
index eaf5103920..3f1e609028 100644
--- a/target/moxie/translate.c
+++ b/target/moxie/translate.c
@@ -832,7 +832,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
ctx.singlestep_enabled = 0;
ctx.bstate = BS_NONE;
num_insns = 0;
- max_insns = tb->cflags & CF_COUNT_MASK;
+ max_insns = tb_cflags(tb) & CF_COUNT_MASK;
if (max_insns == 0) {
max_insns = CF_COUNT_MASK;
}