From: Raushaniya Maksudova <[email protected]>

Signed-off-by: Raushaniya Maksudova <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Paolo Bonzini <[email protected]>
---
 include/qemu/atomic.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
index bd2c075..d26729a 100644
--- a/include/qemu/atomic.h
+++ b/include/qemu/atomic.h
@@ -249,6 +249,9 @@
 #endif
 #endif
 
+#define atomic_inc_fetch(ptr)  __sync_add_and_fetch(ptr, 1)
+#define atomic_dec_fetch(ptr)  __sync_add_and_fetch(ptr, -1)
+
 /* Provide shorter names for GCC atomic builtins.  */
 #define atomic_fetch_inc(ptr)  __sync_fetch_and_add(ptr, 1)
 #define atomic_fetch_dec(ptr)  __sync_fetch_and_add(ptr, -1)
-- 
2.1.4


Reply via email to