summaryrefslogtreecommitdiffstats
path: root/exec.h
diff options
context:
space:
mode:
authorbellard2003-06-09 17:29:55 +0200
committerbellard2003-06-09 17:29:55 +0200
commita95c67907cce5b03269581b77f014ec51b98da36 (patch)
tree9420cb5a39a8c683db1e6ecf13b704cfdc5e7e6d /exec.h
parentremoved unused code (diff)
downloadqemu-a95c67907cce5b03269581b77f014ec51b98da36.tar.gz
qemu-a95c67907cce5b03269581b77f014ec51b98da36.tar.xz
qemu-a95c67907cce5b03269581b77f014ec51b98da36.zip
arm support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@221 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.h')
-rw-r--r--exec.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/exec.h b/exec.h
index d8fc640b63..b6ba663640 100644
--- a/exec.h
+++ b/exec.h
@@ -246,6 +246,18 @@ static inline int testandset (int *p)
}
#endif
+#ifdef __arm__
+static inline int testandset (int *spinlock)
+{
+ register unsigned int ret;
+ __asm__ __volatile__("swp %0, %1, [%2]"
+ : "=r"(ret)
+ : "0"(1), "r"(spinlock));
+
+ return ret;
+}
+#endif
+
typedef int spinlock_t;
#define SPIN_LOCK_UNLOCKED 0