cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

inc_not_zero (345B)


      1cat <<EOF
      2/**
      3 * arch_${atomic}_inc_not_zero - increment unless the number is zero
      4 * @v: pointer of type ${atomic}_t
      5 *
      6 * Atomically increments @v by 1, if @v is non-zero.
      7 * Returns true if the increment was done.
      8 */
      9static __always_inline bool
     10arch_${atomic}_inc_not_zero(${atomic}_t *v)
     11{
     12	return arch_${atomic}_add_unless(v, 1, 0);
     13}
     14EOF