unicorn/qemu/util
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
..
bitmap.c qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
bitops.c i386: Fix up the Node id for CPUID_8000_001E 2018-07-03 00:31:38 -04:00
cacheinfo.c util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64 2019-05-09 17:43:27 -04:00
crc32.c target/arm: Handle AArch32 CRC instructions 2019-04-27 10:50:25 -04:00
crc32c.c util: Clean up includes 2018-02-19 01:27:55 -05:00
cutils.c util/cutils: Turn FIXME comment into QEMU_BUILD_BUG_ON() 2020-01-14 08:04:30 -05:00
error.c include/qemu/osdep.h: Don't include qapi/error.h 2018-02-21 23:08:18 -05:00
getauxval.c util: Clean up includes 2018-02-19 01:27:55 -05:00
host-utils.c util: Clean up includes 2018-02-19 01:27:55 -05:00
log.c util: Move qemu-log to utils 2018-02-25 22:17:44 -05:00
Makefile.objs target/arm: Handle AArch32 CRC instructions 2019-04-27 10:50:25 -04:00
mmap-alloc.c mmap-alloc: fix hugetlbfs misaligned length in ppc64 2019-02-05 16:52:39 -05:00
module.c util: Clean up includes 2018-02-19 01:27:55 -05:00
oslib-posix.c mmap-alloc: fix hugetlbfs misaligned length in ppc64 2019-02-05 16:52:39 -05:00
oslib-win32.c util: move declarations out of qemu-common.h 2018-02-22 09:25:48 -05:00
qemu-error.c util: Clean up includes 2018-02-19 01:27:55 -05:00
qemu-thread-posix.c qemu-thread: Don't block SEGV, ILL and FPE 2019-01-13 19:50:32 -05:00
qemu-thread-win32.c qemu-thread-win32: Prevent null pointer dereference in win32_start_routine 2018-03-21 12:42:44 -04:00
qemu-timer-common.c util: Clean up includes 2018-02-19 01:27:55 -05:00
range.c Don't talk about the LGPL if the file is licensed under the GPL 2019-02-03 17:55:28 -05:00
sys_membarrier.c membarrier: add --enable-membarrier 2018-03-17 19:30:43 -04:00