unicorn/qemu/target/mips
Emilio G. Cota c384da2f47
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.

Backports commit c5a49c63fa26e8825ad101dfe86339ae4c216539 from qemu
2018-03-13 14:57:51 -04:00
..
cp0_timer.c mips: introduce internal.h and cleanup cpu.h 2018-03-05 00:25:56 -05:00
cpu-qom.h mips: MIPSCPU model subclasses 2018-03-05 00:42:29 -05:00
cpu.c qom: Introduce CPUClass.tcg_initialize 2018-03-05 09:49:26 -05:00
cpu.h target/mips/translate: Perform comparison pass with qemu 2018-03-12 17:52:56 -04:00
dsp_helper.c mips: Improve macro parenthesization 2018-03-05 00:51:51 -05:00
helper.c target/mips/helper: Perform comparison pass with qemu 2018-03-12 15:11:52 -04:00
helper.h target/mips: Add segmentation control registers 2018-03-04 01:00:42 -05:00
internal.h target/mips/internal: Perform comparison pass with qemu 2018-03-12 15:13:17 -04:00
lmi_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
Makefile.objs mips: introduce internal.h and cleanup cpu.h 2018-03-05 00:25:56 -05:00
mips-defs.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
msa_helper.c target/mips/msa_helper: Perform comparison pass with qemu 2018-03-12 15:15:42 -04:00
op_helper.c target/mips/op_helper: Perform comparison pass with qemu 2018-03-12 15:25:08 -04:00
TODO Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
translate.c tcg: convert tb->cflags reads to tb_cflags(tb) 2018-03-13 14:57:51 -04:00
translate_init.c target/mips/translate: Perform comparison pass with qemu 2018-03-12 17:52:56 -04:00
unicorn.c Use DEFINE_MACHINE() to register all machines 2018-03-11 15:12:46 -04:00
unicorn.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00