0.8.3.1
[sbcl.git] / src / runtime / x86-arch.h
1 /* FIXME: Aren't preprocessor symbols with underscore prefixes
2  * reserved for the system libraries? If so, it would be tidy to
3  * rename flags like _X86_ARCH_H so their names are in a part of the
4  * namespace that we control. */
5 #ifndef _X86_ARCH_H
6 #define _X86_ARCH_H
7
8 #define ARCH_HAS_STACK_POINTER
9
10 /* FIXME: Do we also want
11  *   #define ARCH_HAS_FLOAT_REGISTERS
12  * here? (The answer wasn't obvious to me when merging the
13  * architecture-abstracting patches for CSR's SPARC port. -- WHN 2002-02-15) */
14
15 static inline void 
16 get_spinlock(lispobj *word,int value)
17 {
18     u32 eax=0;
19     do {
20         asm ("xor %0,%0\n\
21               lock cmpxchg %1,%2" 
22              : "=a" (eax)
23              : "r" (value), "m" (*word)
24              : "memory", "cc");
25     } while(eax!=0);
26 }
27
28 static inline void
29 release_spinlock(lispobj *word)
30 {
31     *word=0;
32 }
33
34 #endif /* _X86_ARCH_H */