From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxF7-0005u4-K4 for qemu-devel@nongnu.org; Fri, 16 Sep 2016 13:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkxF4-0007L9-G5 for qemu-devel@nongnu.org; Fri, 16 Sep 2016 13:48:05 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxF4-0007Kz-AD for qemu-devel@nongnu.org; Fri, 16 Sep 2016 13:48:02 -0400 Received: by mail-pf0-f196.google.com with SMTP id n24so3877569pfb.3 for ; Fri, 16 Sep 2016 10:48:02 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Fri, 16 Sep 2016 10:46:23 -0700 Message-Id: <1474048017-26696-2-git-send-email-rth@twiddle.net> In-Reply-To: <1474048017-26696-1-git-send-email-rth@twiddle.net> References: <1474048017-26696-1-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 01/35] atomics: add atomic_xor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Emilio G. Cota" From: "Emilio G. Cota" This paves the way for upcoming work. Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson Message-Id: <1467054136-10430-8-git-send-email-cota@braap.org> --- include/qemu/atomic.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 0cce246..0124289 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -193,6 +193,7 @@ #define atomic_fetch_sub(ptr, n) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST) #define atomic_fetch_and(ptr, n) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST) #define atomic_fetch_or(ptr, n) __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST) +#define atomic_fetch_xor(ptr, n) __atomic_fetch_xor(ptr, n, __ATOMIC_SEQ_CST) /* And even shorter names that return void. */ #define atomic_inc(ptr) ((void) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST)) @@ -201,6 +202,7 @@ #define atomic_sub(ptr, n) ((void) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST)) #define atomic_and(ptr, n) ((void) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST)) #define atomic_or(ptr, n) ((void) __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST)) +#define atomic_xor(ptr, n) ((void) __atomic_fetch_xor(ptr, n, __ATOMIC_SEQ_CST)) #else /* __ATOMIC_RELAXED */ @@ -387,6 +389,7 @@ #define atomic_fetch_sub __sync_fetch_and_sub #define atomic_fetch_and __sync_fetch_and_and #define atomic_fetch_or __sync_fetch_and_or +#define atomic_fetch_xor __sync_fetch_and_xor #define atomic_cmpxchg __sync_val_compare_and_swap /* And even shorter names that return void. */ @@ -396,6 +399,7 @@ #define atomic_sub(ptr, n) ((void) __sync_fetch_and_sub(ptr, n)) #define atomic_and(ptr, n) ((void) __sync_fetch_and_and(ptr, n)) #define atomic_or(ptr, n) ((void) __sync_fetch_and_or(ptr, n)) +#define atomic_xor(ptr, n) ((void) __sync_fetch_and_xor(ptr, n)) #endif /* __ATOMIC_RELAXED */ #endif /* QEMU_ATOMIC_H */ -- 2.5.5