aboutsummaryrefslogtreecommitdiff
path: root/exec-all.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-17 23:46:04 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-17 23:46:04 +0000
commitbc51c5c989c12b3936b78c5772a3308629a7484c (patch)
tree73f24550783bf7685add8e5828ffd28815759c7f /exec-all.h
parent5069146392ab358b106ed6a7a05440c69924448d (diff)
initial x86-64 host support (Gwenole Beauchesne)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@670 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-all.h')
-rw-r--r--exec-all.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/exec-all.h b/exec-all.h
index 3c79eca917..9ecf2dca7f 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -400,6 +400,20 @@ static inline int testandset (int *p)
}
#endif
+#ifdef __x86_64__
+static inline int testandset (int *p)
+{
+ char ret;
+ int readval;
+
+ __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"
+ : "=q" (ret), "=m" (*p), "=a" (readval)
+ : "r" (1), "m" (*p), "a" (0)
+ : "memory");
+ return ret;
+}
+#endif
+
#ifdef __s390__
static inline int testandset (int *p)
{