aboutsummaryrefslogtreecommitdiff
path: root/exec-i386.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-29 21:07:28 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-29 21:07:28 +0000
commite026db5893aeff66bbc1153002b5285bc361c0a2 (patch)
tree70b3c0012c1d7591d5a39a9cd44664164e94bc73 /exec-i386.c
parent43f04c233cb7d1731613bd6399c32ed09db01c16 (diff)
alpha support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@111 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-i386.c')
-rw-r--r--exec-i386.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/exec-i386.c b/exec-i386.c
index b75c6c70a0..508d068824 100644
--- a/exec-i386.c
+++ b/exec-i386.c
@@ -102,6 +102,25 @@ static inline int testandset (int *p)
}
#endif
+#ifdef __alpha__
+int testandset (int *p)
+{
+ int ret;
+ unsigned long one;
+
+ __asm__ __volatile__ ("0: mov 1,%2\n"
+ " ldl_l %0,%1\n"
+ " stl_c %2,%1\n"
+ " beq %2,1f\n"
+ ".subsection 2\n"
+ "1: br 0b\n"
+ ".previous"
+ : "=r" (ret), "=m" (*p), "=r" (one)
+ : "m" (*p));
+ return ret;
+}
+#endif
+
int global_cpu_lock = 0;
void cpu_lock(void)