if [ $sbcl_arch = "x86" ]; then
printf ' :sb-lutex :restore-fs-segment-register-from-tls' >> $ltf
fi
+ if [ $sbcl_arch = "x86-64" ]; then
+ printf ' :sb-lutex' >> $ltf
+ fi
link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
link_or_copy bsd-os.h target-os.h
link_or_copy Config.$sbcl_arch-darwin Config
preserve_pointer((void*)*os_context_register_addr(c,reg_ESI));
preserve_pointer((void*)*os_context_register_addr(c,reg_EDI));
preserve_pointer((void*)*os_context_pc_addr(c));
+#elif defined LISP_FEATURE_X86_64
+ preserve_pointer((void*)*os_context_register_addr(c,reg_RAX));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_RCX));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_RDX));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_RBX));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_RSI));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_RDI));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R8));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R9));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R10));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R11));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R12));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R13));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R14));
+ preserve_pointer((void*)*os_context_register_addr(c,reg_R15));
+ preserve_pointer((void*)*os_context_pc_addr(c));
#else
#error "preserve_context_registers needs to be tweaked for non-x86 Darwin"
#endif
if(*word==value)
lose("recursive get_spinlock: 0x%x,%ld\n",word,value);
do {
+#if defined(LISP_FEATURE_DARWIN)
+ asm ("xor %0,%0\n\
+ lock/cmpxchg %1,%2"
+ : "=a" (rax)
+ : "r" (value), "m" (*word)
+ : "memory", "cc");
+#else
asm ("xor %0,%0\n\
lock cmpxchg %1,%2"
: "=a" (rax)
: "r" (value), "m" (*word)
: "memory", "cc");
+#endif
} while(rax!=0);
#else
*word=value;
push %rsi #
push %rdx #
#ifdef LISP_FEATURE_SB_THREAD
+#ifdef LISP_FEATURE_DARWIN
+ mov GSYM(GNAME(specials)),%rdi
+#else
mov specials,%rdi
- call pthread_getspecific
+#endif
+ call GNAME(pthread_getspecific)
mov %rax,%r12
#endif
pop %rcx # num args
#-sunos "cc" #+sunos "gcc"
(or #+(or linux freebsd sunos) '(#+x86-64 "-fPIC"
"-shared" "-o" "threads-foreign.so" "threads-foreign.c")
- #+darwin '("-dynamiclib" "-o" "threads-foreign.so" "threads-foreign.c")
+ #+darwin '(#+x86-64 "-arch" #+x86-64 "x86_64"
+ "-dynamiclib" "-o" "threads-foreign.so" "threads-foreign.c")
(error "Missing shared library compilation options for this platform"))
:search t)
(sb-alien:load-shared-object "threads-foreign.so")