aboutsummaryrefslogtreecommitdiff
path: root/exec-i386.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-29 21:26:53 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-29 21:26:53 +0000
commitd014c98c8dce88c3b6cc19bd2e0e558900f5c1d0 (patch)
tree89cb45f50dcf91a6445f6aa312cd8ac24136705c /exec-i386.c
parenta98fd896cdcab506e734de7555304da16e775277 (diff)
sparc support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@119 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 508d068824..ecb7adc9d6 100644
--- a/exec-i386.c
+++ b/exec-i386.c
@@ -121,6 +121,20 @@ int testandset (int *p)
}
#endif
+#ifdef __sparc__
+static inline int testandset (int *p)
+{
+ int ret;
+
+ __asm__ __volatile__("ldstub [%1], %0"
+ : "=r" (ret)
+ : "r" (p)
+ : "memory");
+
+ return (ret ? 1 : 0);
+}
+#endif
+
int global_cpu_lock = 0;
void cpu_lock(void)