unicorn/qemu/include/exec
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
..
address-spaces.h Clean up header guards that don't match their file name 2018-02-25 04:18:42 -05:00
cpu-all.h exec: introduce MemoryRegionCache 2018-03-01 10:50:30 -05:00
cpu-common.h cpu: Introduce a wrapper for tlb_flush() that can be used in common code 2018-03-03 21:24:55 -05:00
cpu-defs.h tcg: add CONFIG_TCG guards in headers 2018-03-03 21:37:52 -05:00
cpu_ldst.h cpu_ldst.h: use correct guest address parameter 2018-03-01 08:56:37 -05:00
cpu_ldst_template.h softmmu: add helper function to pass through retaddr 2018-02-17 15:23:38 -05:00
cputlb.h exec: Drop unnecessary code for unicorn 2018-03-12 10:11:46 -04:00
exec-all.h tcg: Include CF_COUNT_MASK in CF_HASH_MASK 2018-03-13 14:42:42 -04:00
gen-icount.h tcg: convert tb->cflags reads to tb_cflags(tb) 2018-03-13 14:57:51 -04:00
helper-gen.h tcg: Introduce tcgv_{i32,i64,ptr}_{arg,temp} 2018-03-05 08:46:12 -05:00
helper-head.h include/exec/helper-head.h: support f16 in helper calls 2018-03-08 12:28:05 -05:00
helper-proto.h Clean up decorations and whitespace around header guards 2018-02-25 04:26:02 -05:00
helper-tcg.h tcg: Expand glue macros before stringifying helper names 2018-03-03 23:07:21 -05:00
hwaddr.h qemu-common: push cpu.h inclusion out of qemu-common.h 2018-02-24 01:50:56 -05:00
ioport.h hw: remove pio_addr_t 2018-02-24 02:43:16 -05:00
memattrs.h memory.h: Move MemTxResult type to memattrs.h 2018-03-04 13:10:47 -05:00
memory-internal.h memory: Rename mem_begin/mem_commit/mem_add helpers 2018-03-11 21:36:50 -04:00
memory.h memory: Share special empty FlatView 2018-03-11 22:34:28 -04:00
ram_addr.h exec: Drop unnecessary code for unicorn 2018-03-12 10:11:46 -04:00
ramlist.h memory: RCU ram_list.dirty_memory[] for safe RAM hotplug 2018-02-22 15:38:03 -05:00
semihost.h exec: Add semihosting stubs 2018-02-17 15:23:33 -05:00
tb-context.h tb hash: track translated blocks with qht 2018-03-13 14:16:26 -04:00
tb-hash-xx.h tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASK 2018-03-13 14:32:43 -04:00
tb-hash.h tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASK 2018-03-13 14:32:43 -04:00
tb-lookup.h tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASK 2018-03-13 14:32:43 -04:00
translator.h tcg: Add generic translation framework 2018-03-04 14:31:16 -05:00