mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-10-27 11:07:26 +00:00
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 |
||
|---|---|---|
| .. | ||
| address-spaces.h | ||
| cpu-all.h | ||
| cpu-common.h | ||
| cpu-defs.h | ||
| cpu_ldst.h | ||
| cpu_ldst_template.h | ||
| cputlb.h | ||
| exec-all.h | ||
| gen-icount.h | ||
| helper-gen.h | ||
| helper-head.h | ||
| helper-proto.h | ||
| helper-tcg.h | ||
| hwaddr.h | ||
| ioport.h | ||
| memattrs.h | ||
| memory-internal.h | ||
| memory.h | ||
| ram_addr.h | ||
| ramlist.h | ||
| semihost.h | ||
| tb-context.h | ||
| tb-hash-xx.h | ||
| tb-hash.h | ||
| tb-lookup.h | ||
| translator.h | ||