unicorn/qemu/include/exec
Stefan Hajnoczi 320b59ddb9 qemu/atomic.h: rename atomic_ to qatomic_
clang's C11 atomic_fetch_*() functions only take a C11 atomic type
pointer argument. QEMU uses direct types (int, etc) and this causes a
compiler error when a QEMU code calls these functions in a source file
that also included <stdatomic.h> via a system header file:

$ CC=clang CXX=clang++ ./configure ... && make
../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)

Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
searched GitHub for existing "qatomic_" users but there seem to be none.

This patch was generated using:

$ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
sort -u >/tmp/changed_identifiers
$ for identifier in $(</tmp/changed_identifiers); do
sed -i "s%\<$identifier\>%q$identifier%g" \
$(git grep -I -l "\<$identifier\>")
done

I manually fixed line-wrap issues and misaligned rST tables.

Backports d73415a315471ac0b127ed3fad45c8ec5d711de1
2021-03-08 14:34:35 -05:00
..
address-spaces.h
cpu-all.h bswap.h: Remove unused float-access functions 2021-03-04 18:37:02 -05:00
cpu-common.h
cpu-defs.h include/exec/cpu-defs.h: fix typo 2019-11-28 02:38:15 -05:00
cpu_ldst.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
cpu_ldst_template.h cpu_ldst_template.h: Drop unused cpu_ldfq/stfq/ldfl/stfl accessors 2019-04-22 07:21:03 -04:00
cpu_ldst_useronly_template.h cpu_ldst.h: Use inline functions for usermode cpu_ld/st accessors 2019-04-22 07:08:39 -04:00
cputlb.h
exec-all.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
gen-icount.h cpu: Move icount_decr to CPUNegativeOffsetState 2019-06-13 15:34:28 -04:00
helper-gen.h tcg: Add support for a helper with 7 arguments 2020-03-21 16:53:56 -04:00
helper-head.h tcg: Add support for a helper with 7 arguments 2020-03-21 16:53:56 -04:00
helper-proto.h tcg: Use memset for large vector byte replication 2021-03-03 19:28:15 -05:00
helper-tcg.h tcg: Add support for a helper with 7 arguments 2020-03-21 16:53:56 -04:00
hwaddr.h
ioport.h
memattrs.h cputlb: Byte swap memory transaction attribute 2020-01-07 19:15:33 -05:00
memop.h cputlb: Replace size and endian operands for MemOp 2020-01-07 19:03:51 -05:00
memory-internal.h
memory.h memory: Do not allow direct write access to rom_device regions 2020-04-30 07:26:06 -04:00
ram_addr.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
ramlist.h
semihost.h
tb-context.h
tb-hash.h tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASK 2019-05-04 22:22:06 -04:00
tb-lookup.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
translator.h tcg: Hoist max_insns computation to tb_gen_code 2019-04-30 09:49:57 -04:00