mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
atomic_add_negative() does not provide the relaxed/acquire/release variants. Provide them in preparation for a new scalable reference count algorithm. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected]
16 lines
435 B
Plaintext
Executable File
16 lines
435 B
Plaintext
Executable File
cat <<EOF
|
|
/**
|
|
* arch_${atomic}_add_negative${order} - Add and test if negative
|
|
* @i: integer value to add
|
|
* @v: pointer of type ${atomic}_t
|
|
*
|
|
* Atomically adds @i to @v and returns true if the result is negative,
|
|
* or false when the result is greater than or equal to zero.
|
|
*/
|
|
static __always_inline bool
|
|
arch_${atomic}_add_negative${order}(${int} i, ${atomic}_t *v)
|
|
{
|
|
return arch_${atomic}_add_return${order}(i, v) < 0;
|
|
}
|
|
EOF
|