qemu/bsd-user
Emanuele Giuseppe Esposito e022d9cab7 bsd-user/mmap: use TSA_NO_TSA to suppress clang TSA warnings in FreeBSD
FreeBSD implements pthread headers using TSA (thread safety analysis)
annotations, therefore when an application is compiled with
-Wthread-safety there are some locking/annotation requirements that the
user of the pthread API has to follow.

This will also be the case in QEMU, since bsd-user/mmap.c uses the
pthread API. Therefore when building it with -Wthread-safety the
compiler will throw warnings because the functions are not properly
annotated. We need TSA to be enabled because it ensures that the
critical sections of an annotated variable are properly locked.

In order to make the compiler happy and avoid adding all the necessary
macros to all callers (lock functions should use TSA_ACQUIRE, while
unlock TSA_RELEASE, and this applies to all users of pthread_mutex_lock
and pthread_mutex_unlock), simply use TSA_NO_TSA to supppress such
warnings.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20230117135203.3049709-3-eesposit@redhat.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17 11:22:19 +01:00
..
arm bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
freebsd bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
host bsd-user: Catch up with sys/param.h requirement for machine/pmap.h 2022-10-26 14:09:17 -06:00
i386 bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
include user: move common-user includes to a subdirectory of {bsd,linux}-user/ 2022-01-12 14:08:29 +01:00
netbsd Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
openbsd Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
x86_64 bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
bsd-file.h bsd-user: Remove stray 'inline' from do_bsd_close 2022-07-02 07:52:48 -06:00
bsd-proc.h bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
bsdload.c bsd-user: TARGET_NGROUPS unused in this file, remove 2021-09-10 14:13:06 -06:00
elfcore.c bsd-user: add stubbed out core dump support 2021-09-10 14:13:06 -06:00
elfload.c Drop more useless casts from void * to pointer 2022-12-14 16:19:35 +01:00
errno_defs.h Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
main.c bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
meson.build bsd-user: Move system call building to os-syscall.c 2022-02-26 10:01:38 -07:00
mmap.c accel/tcg: Call tb_invalidate_phys_page for PAGE_RESET 2022-10-26 11:11:28 +10:00
qemu.h bsd-user/mmap: use TSA_NO_TSA to suppress clang TSA warnings in FreeBSD 2023-02-17 11:22:19 +01:00
signal-common.h bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026 2022-02-01 14:43:20 -07:00
signal.c compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
strace.c bsd-user: Clean up includes 2023-02-08 07:16:23 +01:00
syscall_defs.h bsd-user: Implement open, openat and close 2022-06-13 15:48:09 -06:00
trace-events bsd-user: Add trace events for bsd-user 2022-01-28 15:53:41 -07:00
trace.h bsd-user: Add trace events for bsd-user 2022-01-28 15:53:41 -07:00
uaccess.c bsd-user: style tweak: keyword space ( 2021-05-11 11:07:22 -06:00