diff options
Diffstat (limited to 'scripts/atomic/fallbacks/inc_unless_negative')
-rwxr-xr-x | scripts/atomic/fallbacks/inc_unless_negative | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/atomic/fallbacks/inc_unless_negative b/scripts/atomic/fallbacks/inc_unless_negative index 95d8ce48233f..e70d9fdfc3d6 100755 --- a/scripts/atomic/fallbacks/inc_unless_negative +++ b/scripts/atomic/fallbacks/inc_unless_negative @@ -1,3 +1,16 @@ +if /bin/sh ${ATOMICDIR}/chkdup.sh arch_${atomic}_inc_unless_negative inc_unless_negative +then +cat <<EOF +/** + * arch_${atomic}_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type ${atomic}_t + * + * Atomically increment @v with full ordering, but only if the original + * value is greater than or equal to zero. Return @true if the increment + * happened and @false otherwise. + */ +EOF +fi cat <<EOF static __always_inline bool arch_${atomic}_inc_unless_negative(${atomic}_t *v) |