unicorn/qemu/target/sparc
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
..
asi.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cc_helper.c target/sparc/cc_helper: Perform a comparison pass against qemu 2018-03-12 12:36:51 -04:00
cpu-qom.h sparc: convert cpu models to SPARC cpu subclasses 2018-03-07 21:30:22 -05:00
cpu.c sparc: move adhoc CPUSPARCState initialization to realize time 2018-03-07 21:40:33 -05:00
cpu.h target/*/cpu.h: remove softfloat.h 2018-03-08 09:58:47 -05:00
fop_helper.c target/sparc/fop_helper: Perform comparison pass against qemu 2018-03-12 12:38:21 -04:00
helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
helper.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
int32_helper.c sparc: embed sparc_def_t into CPUSPARCState 2018-03-07 21:35:23 -05:00
int64_helper.c sparc: embed sparc_def_t into CPUSPARCState 2018-03-07 21:35:23 -05:00
ldst_helper.c target/sparc/ldst_helper: Perform comparison pass against qemu 2018-03-12 12:43:14 -04:00
Makefile.objs Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
mmu_helper.c target/sparc/mmu_helper: Perform comparison pass against qemu 2018-03-12 12:45:18 -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
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
unicorn64.c Revert use of DEFINE_MACHINE() for registrations of multiple machines 2018-03-11 15:17:17 -04:00
vis_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
win_helper.c target/sparc/win_helper: Perform comparison pass against qemu 2018-03-12 12:46:59 -04:00