summaryrefslogtreecommitdiff
path: root/exec-all.h
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-05 19:23:11 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-05 19:23:11 +0000
commitc4b89d18ba3b494545266970fe8714bc3d7f5917 (patch)
tree85543844ae6a8c7f7e7b3dd73d804a9c8161c835 /exec-all.h
parent26ea091859c76d5e1b8a95148aa60b59dc8ee196 (diff)
downloadqemu-c4b89d18ba3b494545266970fe8714bc3d7f5917.tar.gz
Some bits of Linux/MIPS host support, still segfaulty.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2771 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-all.h')
-rw-r--r--exec-all.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/exec-all.h b/exec-all.h
index cb8936a69b..bc118c8a43 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -481,6 +481,28 @@ static inline int testandset (int *p)
}
#endif
+#ifdef __mips__
+static inline int testandset (int *p)
+{
+ int ret;
+
+ __asm__ __volatile__ (
+ " .set push \n"
+ " .set noat \n"
+ " .set mips2 \n"
+ "1: li $1, 1 \n"
+ " ll %0, %1 \n"
+ " sc $1, %1 \n"
+ " bnez $1, 1b \n"
+ " .set pop "
+ : "=r" (ret), "+R" (*p)
+ :
+ : "memory");
+
+ return ret;
+}
+#endif
+
typedef int spinlock_t;
#define SPIN_LOCK_UNLOCKED 0