tools: virtio/linux/compiler.h: Add data_race() define.
authorYufeng Wang <wangyufeng@kylinos.cn>
Tue, 14 Jan 2025 03:36:35 +0000 (11:36 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 25 Feb 2025 12:10:45 +0000 (07:10 -0500)
commit83dc0370f915b9ad996387c141399615627e32b6
treef1b9858a62b68836a47a8f1e7e39c4dfa944418e
parentae376910f52b815003d433243bee93ca000537c0
tools: virtio/linux/compiler.h: Add data_race() define.

Port over the definition of data_race() so we can build tools/virtio.

cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I.
-I../include/ -I ../../usr/include/ -Wno-pointer-sign
-fno-strict-overflow -fno-strict-aliasing -fno-common
-MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
-mfunction-return=thunk -fcf-protection=none
-mindirect-branch-register -pthread
-c -o virtio_ring.o ../../drivers/virtio/virtio_ring.c
../../drivers/virtio/virtio_ring.c: in function'vring_interrupt':
../../drivers/virtio/virtio_ring.c:2711:17: error:Implicit declaration function'data_race' [-Wimplicit-function-declaration]
 2711 |                 data_race(vq->event_triggered = true);
      |                 ^~~~~~~~~

Signed-off-by: Yufeng Wang <wangyufeng@kylinos.cn>
Message-Id: <20250114033635.20623-1-wangyufeng@kylinos.cn>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/linux/compiler.h