Commit d78601ed authored by Zizhi Wo's avatar Zizhi Wo Committed by Baokun Li
Browse files

s390: provide arch_test_bit_acquire() for architecture s390

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT



--------------------------------

Architecture s390 did not define arch_test_bit_acquire() implementation,
thus the compilation will fail.

This patch has carried the function implementation to fix this problem.
The mainline patch to fix this problem is d6ffe606 ("provide
arch_test_bit_acquire for architectures that define test_bit"), but due to
a large adaptation conflicts, we came up with a patch of own.

Fixes: 8238b457 ("wait_on_bit: add an acquire memory barrier")
Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
parent c82f2c50
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -241,6 +241,13 @@ static inline void arch___clear_bit_unlock(unsigned long nr,
	arch___clear_bit(nr, ptr);
}

static __always_inline bool
arch_test_bit_acquire(unsigned long nr, const volatile unsigned long *addr)
{
	unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
	return 1UL & (smp_load_acquire(p) >> (nr & (BITS_PER_LONG-1)));
}

#include <asm-generic/bitops/instrumented-atomic.h>
#include <asm-generic/bitops/instrumented-non-atomic.h>
#include <asm-generic/bitops/instrumented-lock.h>