aboutsummaryrefslogtreecommitdiff
path: root/exec-i386.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-29 17:32:36 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-29 17:32:36 +0000
commitfb3e5849bb139e8213b7afb5abd7ef5cc985d10b (patch)
tree667fc6ee486c6a762c1fddb007396660ae3f5733 /exec-i386.c
parent7854b05654b49c2197faef358e3ec1a7559797b9 (diff)
s390 support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@65 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-i386.c')
-rw-r--r--exec-i386.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/exec-i386.c b/exec-i386.c
index f59e1ccecf..dedcbfabd6 100644
--- a/exec-i386.c
+++ b/exec-i386.c
@@ -87,6 +87,20 @@ static inline int testandset (int *p)
}
#endif
+#ifdef __s390__
+static inline int testandset (int *p)
+{
+ int ret;
+
+ __asm__ __volatile__ ("0: cs %0,%1,0(%2)\n"
+ " jl 0b"
+ : "=&d" (ret)
+ : "r" (1), "a" (p), "0" (*p)
+ : "cc", "memory" );
+ return ret;
+}
+#endif
+
int global_cpu_lock = 0;
void cpu_lock(void)