unicorn/qemu/target/m68k
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
..
cpu-qom.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cpu.c target/*/cpu.h: remove softfloat.h 2018-03-08 09:58:47 -05:00
cpu.h target/m68k: add fmod/frem 2018-03-09 01:28:58 -05:00
fpu_helper.c target/m68k/op_helper: Adjust formatting to be in sync with qemu 2018-03-12 12:26:53 -04:00
helper.c target/*/cpu.h: remove softfloat.h 2018-03-08 09:58:47 -05:00
helper.h target/m68k: implement ftentox 2018-03-12 10:11:48 -04:00
Makefile.objs target/m68k: add fmod/frem 2018-03-09 01:28:58 -05:00
op_helper.c target/m68k/op_helper: Adjust formatting to be in sync with qemu 2018-03-12 12:26:53 -04:00
qregs.def target-m68k: use floatx80 internally 2018-03-03 19:35:17 -05:00
softfloat.c target/m68k: implement ftentox 2018-03-12 10:11:48 -04:00
softfloat.h target/m68k: implement ftentox 2018-03-12 10:11:48 -04:00
softfloat_fpsp_tables.h target/m68k: implement ftwotox 2018-03-12 10:11:48 -04:00
translate.c tcg: convert tb->cflags reads to tb_cflags(tb) 2018-03-13 14:57:51 -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