*参照元 [#ie766313] #backlinks *説明 [#v98d0d71] -パス: 複数あり --汎用: [[linux-2.6.33/include/asm-generic/atomic.h]] -アトミック値から指定した値を減算し、減算後の値を返す。 **引数 [#x0b8e60a] -int i -- -atomic_t *v -- --[[linux-2.6.33/atomic_t]] **返り値 [#n37146b4] -int --減算後の値 **参考 [#w74de1f6] *実装 [#e312f3b8] /** * atomic_sub_return - subtract integer from atomic variable * @i: integer value to subtract * @v: pointer of type atomic_t * * Atomically subtracts @i from @v and returns the result * Note that the guaranteed useful range of an atomic_t is only 24 bits. */ static inline int atomic_sub_return(int i, atomic_t *v) { unsigned long flags; int temp; local_irq_save(flags); temp = v->counter; temp -= i; v->counter = temp; local_irq_restore(flags); return temp; } *コメント [#w9620954]