diff options
Diffstat (limited to 'exec-i386.c')
-rw-r--r-- | exec-i386.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/exec-i386.c b/exec-i386.c index 508d068824..ecb7adc9d6 100644 --- a/exec-i386.c +++ b/exec-i386.c @@ -121,6 +121,20 @@ int testandset (int *p) } #endif +#ifdef __sparc__ +static inline int testandset (int *p) +{ + int ret; + + __asm__ __volatile__("ldstub [%1], %0" + : "=r" (ret) + : "r" (p) + : "memory"); + + return (ret ? 1 : 0); +} +#endif + int global_cpu_lock = 0; void cpu_lock(void) |