unicorn/qemu/accel/tcg
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
..
atomic_template.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
cpu-exec-common.c tcg: Fix LGPL version number 2019-02-03 17:55:28 -05:00
cpu-exec.c qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
cputlb.c qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
Makefile.objs tcg: move tcg backend files into accel/tcg/ 2018-03-13 11:48:15 -04:00
tcg-runtime-gvec.c tcg: Implement gvec support for rotate by vector 2020-06-14 21:43:46 -04:00
tcg-runtime.c cpu: Replace ENV_GET_CPU with env_cpu 2019-06-12 11:16:16 -04:00
tcg-runtime.h tcg: Use memset for large vector byte replication 2021-03-03 19:28:15 -05:00
translate-all.c qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
translate-all.h tcg: Synchronize with qemu 2019-04-26 09:32:20 -04:00
translate-common.c tcg: Fix LGPL version number 2019-02-03 17:55:28 -05:00
translator.c unicorn: fix uc_emu_start until if end instruction is in another tlb 2020-08-05 03:18:51 +09:00