x86: Implement atomic[64]_dec_if_positive()
Add support for atomic_dec_if_positive(), and atomic64_dec_if_positive() for x86-64. atomic64_dec_if_positive() for x86-32 was already implemented in a previous patch. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267183361-20775-2-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
committed by
H. Peter Anvin
parent
8f4f202b33
commit
d7f6de1e9c
@ -112,7 +112,7 @@ static __init int test_atomic64(void)
|
||||
r += one;
|
||||
BUG_ON(v.counter != r);
|
||||
|
||||
#if defined(CONFIG_X86_32) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(_ASM_GENERIC_ATOMIC64_H)
|
||||
#if defined(CONFIG_X86) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(_ASM_GENERIC_ATOMIC64_H)
|
||||
INIT(onestwos);
|
||||
BUG_ON(atomic64_dec_if_positive(&v) != (onestwos - 1));
|
||||
r -= one;
|
||||
|
Reference in New Issue
Block a user