ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 1) cat <<EOF
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 2) /**
f3e615b4db1fb (Mark Rutland 2021-07-13 11:52:50 +0100 3) * arch_${atomic}_add_negative - add and test if negative
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 4) * @i: integer value to add
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 5) * @v: pointer of type ${atomic}_t
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 6) *
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 7) * Atomically adds @i to @v and returns true
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 8) * if the result is negative, or false when
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 9) * result is greater than or equal to zero.
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 10) */
765dcd209947e (Marco Elver 2019-11-26 15:04:05 +0100 11) static __always_inline bool
f3e615b4db1fb (Mark Rutland 2021-07-13 11:52:50 +0100 12) arch_${atomic}_add_negative(${int} i, ${atomic}_t *v)
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 13) {
f3e615b4db1fb (Mark Rutland 2021-07-13 11:52:50 +0100 14) return arch_${atomic}_add_return(i, v) < 0;
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 15) }
ace9bad4df268 (Mark Rutland 2018-09-04 11:48:25 +0100 16) EOF