unicorn/qemu/include/qemu
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.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
atomic128.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
bitmap.h qemu: Update bitmap.c/.h 2019-04-26 13:05:55 -04:00
bitops.h qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
bswap.h bswap.h: Remove unused float-access functions 2021-03-04 18:37:02 -05:00
compiler.h qemu/compiler: Split out qemu_build_not_reached_always 2021-03-04 15:23:27 -05:00
cpuid.h util: Introduce include/qemu/cpuid.h 2018-03-09 12:12:00 -05:00
crc32.h target/arm: Handle AArch32 CRC instructions 2019-04-27 10:50:25 -04:00
crc32c.h import 2015-08-21 15:04:50 +08:00
cutils.h Memory: Enable writeback for given memory region 2020-01-14 07:44:24 -05:00
fprintf-fn.h Clean up decorations and whitespace around header guards 2018-02-25 04:26:02 -05:00
host-utils.h qemu/host-utils: Handle ctpop8/16/32/64 on MSVC 2019-01-30 13:29:58 -05:00
int128.h qemu/int128: Add int128_lshift 2021-02-26 13:45:44 -05:00
log.h tcg: Optionally log FPU state in TCG -d cpu logging 2018-05-15 22:31:08 -04:00
mmap-alloc.h mmap-alloc: fix hugetlbfs misaligned length in ppc64 2019-02-05 16:52:39 -05:00
module.h cleanup qemu/include/qemu/module.h 2017-01-25 00:20:08 +08:00
osdep.h osdep.h: Drop no-longer-needed Coverity workarounds 2020-04-30 07:27:24 -04:00
queue.h tcg: Dynamically allocate TCGOps 2018-03-05 16:34:40 -05:00
range.h Don't talk about the LGPL if the file is licensed under the GPL 2019-02-03 17:55:28 -05:00
sys_membarrier.h membarrier: add --enable-membarrier 2018-03-17 19:30:43 -04:00
thread-posix.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
thread-win32.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
thread.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
timer.h Drop remaining bits of ia64 host support 2018-03-09 11:54:57 -05:00
typedefs.h typedefs: Separate incomplete types and function types 2019-11-18 16:42:51 -05:00
units.h include: Add IEC binary prefixes in qemu/units.h 2018-07-03 19:47:19 -04:00
xxhash.h target/arm: Implement an IMPDEF pauth algorithm 2021-03-04 13:38:22 -05:00