aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu/patches/qemu-infrastructure
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ioemu/patches/qemu-infrastructure')
-rw-r--r--tools/ioemu/patches/qemu-infrastructure27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/ioemu/patches/qemu-infrastructure b/tools/ioemu/patches/qemu-infrastructure
new file mode 100644
index 0000000000..1bd4d7e60e
--- /dev/null
+++ b/tools/ioemu/patches/qemu-infrastructure
@@ -0,0 +1,27 @@
+diff -r ead4d7bbf711 cpu-all.h
+--- a/cpu-all.h Tue May 30 13:32:07 2006 +0100
++++ b/cpu-all.h Tue May 30 13:32:25 2006 +0100
+@@ -820,6 +820,23 @@ int cpu_inl(CPUState *env, int addr);
+ int cpu_inl(CPUState *env, int addr);
+ #endif
+
++#if defined(__i386__) || defined(__x86_64__)
++static __inline__ void atomic_set_bit(long nr, volatile void *addr)
++{
++ __asm__ __volatile__(
++ "lock ; bts %1,%0"
++ :"=m" (*(volatile long *)addr)
++ :"dIr" (nr));
++}
++static __inline__ void atomic_clear_bit(long nr, volatile void *addr)
++{
++ __asm__ __volatile__(
++ "lock ; btr %1,%0"
++ :"=m" (*(volatile long *)addr)
++ :"dIr" (nr));
++}
++#endif
++
+ /* memory API */
+
+ extern uint64_t phys_ram_size;