1.0.17.3: unify CONSTANT nodes for DEFCONSTANT and literal constants
[sbcl/tcr.git] / src / runtime / mips-arch.h
blob4ac1b787b3e28f4f9c51d039103734812e6ed81f
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 #ifdef LISP_FEATURE_SB_THREAD
45 __asm__ __volatile__ (
46 " .set push\n"
47 " .set mips2\n"
48 " .set noreorder\n"
49 " sw $0,%[__mem]\n"
50 " sync\n"
51 " .set pop"
53 : [__mem] "R" (*word)
54 : "memory");
55 #else /* LISP_FEATURE_SB_THREAD */
56 *word=0;
57 #endif
60 unsigned int arch_get_fp_control(void);
61 void arch_set_fp_control(unsigned int fp);
63 #endif /* _MIPS_ARCH_H */