+2010-04-23 Geoff Norton <gnorton@novell.com>
+
+ * include/private/gcconfig.h: Darwin x86-64 bit support.
+ * darwin_stop_world.c: Ditto
+
2010-04-19 Jonathan Pryor <jpryor@novell.com>
* include/private/gcconfig.h: Android platforms are built atop Linux,
#elif defined(ARM)
arm_thread_state_t state;
mach_msg_type_number_t thread_state_count = ARM_THREAD_STATE_COUNT;
+#elif defined(X86_64)
+ x86_thread_state64_t state;
+ mach_msg_type_number_t thread_state_count = x86_THREAD_STATE64_COUNT;
#else
# error FIXME for non-x86 || ppc architectures
mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
GC_MACH_THREAD_STATE_FLAVOR,
(natural_t*)&state,
&thread_state_count);
- if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
+ if(r != KERN_SUCCESS) continue;
#if defined(I386)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
GC_push_one(state.esi);
GC_push_one(state.ebp);
#endif
+#elif defined(X86_64)
+ lo = state.__rsp;
+ GC_push_one(state.__rax);
+ GC_push_one(state.__rbx);
+ GC_push_one(state.__rcx);
+ GC_push_one(state.__rdx);
+ GC_push_one(state.__rdi);
+ GC_push_one(state.__rsi);
+ GC_push_one(state.__rbp);
+ GC_push_one(state.__rsp);
+ GC_push_one(state.__r8);
+ GC_push_one(state.__r9);
+ GC_push_one(state.__r10);
+ GC_push_one(state.__r11);
+ GC_push_one(state.__r12);
+ GC_push_one(state.__r13);
+ GC_push_one(state.__r14);
+ GC_push_one(state.__r15);
+ GC_push_one(state.__rip);
+ GC_push_one(state.__rflags);
+ GC_push_one(state.__cs);
+ GC_push_one(state.__fs);
+ GC_push_one(state.__gs);
#elif defined(POWERPC)
#if defined(_STRUCT_PPC_EXCEPTION_STATE)
lo = (void*)(state.__r1 - PPC_RED_ZONE_SIZE);
# define mach_type_known
# define DARWIN_DONT_PARSE_STACK
# define GC_DONT_REGISTER_MAIN_STATIC_DATA
+# elif defined(__x86_64)
+# define X86_64
+# define mach_type_known
# endif
# endif
# if defined(NeXT) && defined(mc68000)
# define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
# endif
# endif
+# ifdef DARWIN
+# define OS_TYPE "DARWIN"
+# define DARWIN_DONT_PARSE_STACK
+# define DYNAMIC_LOADING
+ /* XXX: see get_end(3), get_etext() and get_end() should not be used.
+ These aren't used when dyld support is enabled (it is by default) */
+# define DATASTART ((ptr_t) get_etext())
+# define DATAEND ((ptr_t) get_end())
+# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif
+# define USE_MMAP_ANON
+# ifdef GC_DARWIN_THREADS
+# define MPROTECT_VDB
+# endif
+# include <unistd.h>
+# define GETPAGESIZE() getpagesize()
+ /* There seems to be some issues with trylock hanging on darwin. This
+ should be looked into some more */
+# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# ifndef GC_FREEBSD_THREADS