[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement
commit d2e39d6b753380bf0a73addd6429f69d772d9ad9 Author: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx> AuthorDate: Fri Jul 15 13:42:07 2016 +0300 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Fri Jul 15 13:33:12 2016 +0100 asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement Place atomic_inc_and_test() implementation after atomic_inc(). Also empty line fix. Signed-off-by: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/include/asm-x86/atomic.h | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/xen/include/asm-x86/atomic.h b/xen/include/asm-x86/atomic.h index d246b70..5f9f2dd 100644 --- a/xen/include/asm-x86/atomic.h +++ b/xen/include/asm-x86/atomic.h @@ -110,7 +110,6 @@ static inline int _atomic_read(atomic_t v) return v.counter; } - /** * atomic_set - set atomic variable * @v: pointer of type atomic_t @@ -217,6 +216,25 @@ static inline void atomic_inc(atomic_t *v) } /** + * atomic_inc_and_test - increment and test + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1 + * and returns true if the result is zero, or false for all + * other cases. + */ +static inline int atomic_inc_and_test(atomic_t *v) +{ + unsigned char c; + + asm volatile ( + "lock; incl %0; sete %1" + : "=m" (*(volatile int *)&v->counter), "=qm" (c) + : "m" (*(volatile int *)&v->counter) : "memory" ); + return c != 0; +} + +/** * atomic_dec - decrement atomic variable * @v: pointer of type atomic_t * @@ -250,25 +268,6 @@ static inline int atomic_dec_and_test(atomic_t *v) } /** - * atomic_inc_and_test - increment and test - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1 - * and returns true if the result is zero, or false for all - * other cases. - */ -static inline int atomic_inc_and_test(atomic_t *v) -{ - unsigned char c; - - asm volatile ( - "lock; incl %0; sete %1" - : "=m" (*(volatile int *)&v->counter), "=qm" (c) - : "m" (*(volatile int *)&v->counter) : "memory" ); - return c != 0; -} - -/** * atomic_add_negative - add and test if negative * @v: pointer of type atomic_t * @i: integer value to add -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |