From 5522d1971879a8696d214c6d17756599a8d51c99 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 19 Sep 2023 08:59:10 +0200 Subject: [PATCH] env: posix: Make env_bit_test() atomic Signed-off-by: Robert Baldyga Signed-off-by: Shai Fultheim --- env/posix/ocf_env.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/env/posix/ocf_env.h b/env/posix/ocf_env.h index e1ab63e9..a1113c73 100644 --- a/env/posix/ocf_env.h +++ b/env/posix/ocf_env.h @@ -1,5 +1,6 @@ /* * Copyright(c) 2019-2022 Intel Corporation + * Copyright(c) 2023 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -586,6 +587,7 @@ static inline bool env_bit_test(int nr, const volatile unsigned long *addr) const char *byte = (char *)addr + (nr >> 3); char mask = 1 << (nr & 7); + __sync_synchronize(); return !!(*byte & mask); }