mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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:
parent
26ea091859
commit
c4b89d18ba
7 changed files with 172 additions and 4 deletions
22
exec-all.h
22
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue