diff options
author | Kevin Wolf <kwolf@redhat.com> | 2022-12-07 14:18:27 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-12-15 16:07:43 +0100 |
commit | d9bfb9de00d4ee15908cc2f76333d6657b580dea (patch) | |
tree | c10ca31b2e66454c21bdca098a6371dbbe46fa39 | |
parent | b1cc02e9463a406c6edd7ac55e356cf65a0681d7 (diff) | |
download | qemu-d9bfb9de00d4ee15908cc2f76333d6657b580dea.zip qemu-d9bfb9de00d4ee15908cc2f76333d6657b580dea.tar.gz qemu-d9bfb9de00d4ee15908cc2f76333d6657b580dea.tar.bz2 |
clang-tsa: Add macros for shared locks
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20221207131838.239125-8-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | include/qemu/clang-tsa.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qemu/clang-tsa.h b/include/qemu/clang-tsa.h index 211ee0a..ba06fb8 100644 --- a/include/qemu/clang-tsa.h +++ b/include/qemu/clang-tsa.h @@ -62,6 +62,7 @@ * void Foo(void) TSA_REQUIRES(mutex); */ #define TSA_REQUIRES(...) TSA(requires_capability(__VA_ARGS__)) +#define TSA_REQUIRES_SHARED(...) TSA(requires_shared_capability(__VA_ARGS__)) /* TSA_EXCLUDES() is used to annotate functions: the caller of the * function MUST NOT hold resource, the function first acquires the @@ -82,6 +83,7 @@ * void Foo(void) TSA_ACQUIRE(mutex); */ #define TSA_ACQUIRE(...) TSA(acquire_capability(__VA_ARGS__)) +#define TSA_ACQUIRE_SHARED(...) TSA(acquire_shared_capability(__VA_ARGS__)) /* TSA_RELEASE() is used to annotate functions: the caller of the * function MUST hold the resource, but the function will then release it. @@ -91,6 +93,7 @@ * void Foo(void) TSA_RELEASE(mutex); */ #define TSA_RELEASE(...) TSA(release_capability(__VA_ARGS__)) +#define TSA_RELEASE_SHARED(...) TSA(release_shared_capability(__VA_ARGS__)) /* TSA_NO_TSA is used to annotate functions. Use only when you need to. * @@ -106,5 +109,6 @@ * More than one mutex may be specified, comma-separated. */ #define TSA_ASSERT(...) TSA(assert_capability(__VA_ARGS__)) +#define TSA_ASSERT_SHARED(...) TSA(assert_shared_capability(__VA_ARGS__)) #endif /* #ifndef CLANG_TSA_H */ |