Shorten set-fdefn-fun
[sbcl.git] / src / runtime / mips-arch.h
blobcedd280d9d9881c1db1a73a644ce83a436dc7777
1 #ifndef _MIPS_ARCH_H
2 #define _MIPS_ARCH_H
4 #define ALIEN_STACK_GROWS_DOWNWARD
6 static inline void
7 get_spinlock(volatile lispobj *word, long value)
9 #ifdef LISP_FEATURE_SB_THREAD
10 unsigned long __old = (volatile lispobj)*word;
11 unsigned long __prev;
12 int __cmp;
14 __asm__ __volatile__ (
15 " .set push\n"
16 " .set mips2\n"
17 " .set noreorder\n"
18 "1: ll %[__prev],%[__mem]\n"
19 " bne %[__prev],%[__old],2f\n"
20 " li %[__cmp],0\n"
21 " move %[__cmp],%[__new]\n"
22 " sc %[__cmp],%[__mem]\n"
23 " beqz %[__cmp],1b\n"
24 " nop\n"
25 " sync\n"
26 "2:\n"
27 " .set pop"
28 : [__prev] "=&r" (__prev),
29 [__cmp] "=&r" (__cmp)
30 : [__mem] "R" (*word),
31 [__old] "r" (__old),
32 [__new] "r" (value)
33 : "memory");
35 if (!cmp)
36 lose("recursive get_spinlock: 0x%x,%d\n", word, value);
37 #else /* LISP_FEATURE_SB_THREAD */
38 *word=value;
39 #endif
42 static inline void
43 release_spinlock(volatile lispobj *word)
45 #ifdef LISP_FEATURE_SB_THREAD
46 __asm__ __volatile__ (
47 " .set push\n"
48 " .set mips2\n"
49 " .set noreorder\n"
50 " sw $0,%[__mem]\n"
51 " sync\n"
52 " .set pop"
54 : [__mem] "R" (*word)
55 : "memory");
56 #else /* LISP_FEATURE_SB_THREAD */
57 *word=0;
58 #endif
61 unsigned int arch_get_fp_control(void);
62 void arch_set_fp_control(unsigned int fp);
64 #endif /* _MIPS_ARCH_H */