QEMU is a FAST! processor emulator using dynamic translation to achieve good emulation speed. QEMU has two operating modes: * Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including a processor and various peripherials. It can be used to launch different Operating Systems without rebooting the PC or to debug system code. * User mode emulation (Linux host only). In this mode, QEMU can launch Linux processes compiled for one CPU on another CPU. It can be used to launch the Wine Windows API emulator or to ease cross-compilation and cross-debugging. As QEMU requires no host kernel patches to run, it is very safe and easy to use. See also the preconfigured system images on http://oszoo.org/ Many live cd isos also work. WWW: http://wiki.qemu.org/Main_Page
41 lines
1.9 KiB
C
41 lines
1.9 KiB
C
--- include/qemu/atomic.h.orig 2020-04-28 16:49:24 UTC
|
|
+++ include/qemu/atomic.h
|
|
@@ -228,10 +228,12 @@
|
|
/* And even shorter names that return void. */
|
|
#define atomic_inc(ptr) ((void) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST))
|
|
#define atomic_dec(ptr) ((void) __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST))
|
|
+#ifndef __cplusplus
|
|
#define atomic_add(ptr, n) ((void) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CST))
|
|
#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))
|
|
+#endif
|
|
#define atomic_xor(ptr, n) ((void) __atomic_fetch_xor(ptr, n, __ATOMIC_SEQ_CST))
|
|
|
|
#else /* __ATOMIC_RELAXED */
|
|
@@ -406,10 +408,12 @@
|
|
|
|
#define atomic_inc_fetch(ptr) __sync_add_and_fetch(ptr, 1)
|
|
#define atomic_dec_fetch(ptr) __sync_add_and_fetch(ptr, -1)
|
|
+#ifndef __cplusplus
|
|
#define atomic_add_fetch(ptr, n) __sync_add_and_fetch(ptr, n)
|
|
#define atomic_sub_fetch(ptr, n) __sync_sub_and_fetch(ptr, n)
|
|
#define atomic_and_fetch(ptr, n) __sync_and_and_fetch(ptr, n)
|
|
#define atomic_or_fetch(ptr, n) __sync_or_and_fetch(ptr, n)
|
|
+#endif
|
|
#define atomic_xor_fetch(ptr, n) __sync_xor_and_fetch(ptr, n)
|
|
|
|
#define atomic_cmpxchg(ptr, old, new) __sync_val_compare_and_swap(ptr, old, new)
|
|
@@ -418,10 +422,12 @@
|
|
/* And even shorter names that return void. */
|
|
#define atomic_inc(ptr) ((void) __sync_fetch_and_add(ptr, 1))
|
|
#define atomic_dec(ptr) ((void) __sync_fetch_and_add(ptr, -1))
|
|
+#ifndef __cplusplus
|
|
#define atomic_add(ptr, n) ((void) __sync_fetch_and_add(ptr, n))
|
|
#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))
|
|
+#endif
|
|
#define atomic_xor(ptr, n) ((void) __sync_fetch_and_xor(ptr, n))
|
|
|
|
#endif /* __ATOMIC_RELAXED */
|