From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHboA-0006fK-F5 for qemu-devel@nongnu.org; Mon, 27 Jun 2016 15:02:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHbo6-0008GV-KJ for qemu-devel@nongnu.org; Mon, 27 Jun 2016 15:02:57 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHbo5-0008CC-B4 for qemu-devel@nongnu.org; Mon, 27 Jun 2016 15:02:54 -0400 From: "Emilio G. Cota" Date: Mon, 27 Jun 2016 15:01:53 -0400 Message-Id: <1467054136-10430-8-git-send-email-cota@braap.org> In-Reply-To: <1467054136-10430-1-git-send-email-cota@braap.org> References: <1467054136-10430-1-git-send-email-cota@braap.org> Subject: [Qemu-devel] [RFC 07/30] atomics: add atomic_xor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers , MTTCG Devel Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson , Sergey Fedorov , Alvise Rigo , Peter Maydell This paves the way for upcoming work. Signed-off-by: Emilio G. Cota --- include/qemu/atomic.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 7a59096..a5531da 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -161,6 +161,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)) @@ -169,6 +170,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 */ @@ -355,6 +357,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. */ @@ -364,6 +367,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.0