1.0.5.35: stack alignment on x86/Darwin, once more
[sbcl.git] / src / runtime / mips-arch.h
blobeba16e4f6317eab81f991ed15db105249e78fb22
1 #ifndef _MIPS_ARCH_H
2 #define _MIPS_ARCH_H
5 static inline void
6 get_spinlock(volatile lispobj *word, long value)
8 #ifdef LISP_FEATURE_SB_THREAD
9 unsigned long __old = (volatile lispobj)*word;
10 unsigned long __prev;
11 int __cmp;
13 __asm__ __volatile__ (
14 " .set push\n"
15 " .set mips2\n"
16 " .set noreorder\n"
17 "1: ll %[__prev],%[__mem]\n"
18 " bne %[__prev],%[__old],2f\n"
19 " li %[__cmp],0\n"
20 " move %[__cmp],%[__new]\n"
21 " sc %[__cmp],%[__mem]\n"
22 " beqz %[__cmp],1b\n"
23 " nop\n"
24 " sync\n"
25 "2:\n"
26 " .set pop"
27 : [__prev] "=&r" (__prev),
28 [__cmp] "=&r" (__cmp)
29 : [__mem] "R" (*word),
30 [__old] "r" (__old),
31 [__new] "r" (value)
32 : "memory");
34 if (!cmp)
35 lose("recursive get_spinlock: 0x%x,%d\n", word, value);
36 #else /* LISP_FEATURE_SB_THREAD */
37 *word=value;
38 #endif
41 static inline void
42 release_spinlock(volatile lispobj *word)
44 *word=0;
47 #endif /* _MIPS_ARCH_H */