Add a declaration
[sbcl.git] / src / runtime / ppc-arch.h
bloba5fe1e9ee2769424ca4ab8631d54fa8c194b2b70
1 #ifndef _PPC_ARCH_H
2 #define _PPC_ARCH_H
4 static inline long
5 get_spinlock(lispobj *word,long value)
7 #ifdef LISP_FEATURE_SB_THREAD
8 long temp;
10 asm volatile("1: lwarx %0,0,%1;"
11 " cmpwi %0,0;"
12 " bne- 1b;"
13 " stwcx. %2,0,%1;"
14 " bne- 1b;"
15 " isync"
16 : "=&r" (temp)
17 : "r" (word), "r" (value)
18 : "cr0", "memory");
19 return temp;
20 #else
21 *word=value;
22 return 0;
23 #endif
26 static inline void
27 release_spinlock(lispobj *word)
29 #ifdef LISP_FEATURE_SB_THREAD
30 asm volatile ("sync" : : : "memory");
31 #endif
32 *word=0;
35 #ifdef LISP_FEATURE_SB_THREAD
36 static inline lispobj
37 swap_lispobjs(volatile lispobj *dest, lispobj value)
39 lispobj old_value;
40 asm volatile ("1: lwarx %0,0,%1;"
41 " stwcx. %2,0,%1;"
42 " bne- 1b;"
43 " isync"
44 : "=&r" (old_value)
45 : "r" (dest), "r" (value)
46 : "cr0", "memory");
47 return old_value;
49 #endif
51 #define ARCH_HAS_LINK_REGISTER
52 #define ALIEN_STACK_GROWS_DOWNWARD
54 extern void ppc_flush_icache(os_vm_address_t address, os_vm_size_t length);
56 os_context_register_t *os_context_ctr_addr(os_context_t *context);
57 os_context_register_t *os_context_cr_addr(os_context_t *context);
59 #endif /* _PPC_ARCH_H */