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
This commit is contained in:
ths 2007-05-05 19:23:11 +00:00
parent 26ea091859
commit c4b89d18ba
7 changed files with 172 additions and 4 deletions

View file

@ -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