2010-04-23 Geoff Norton <gnorton@novell.com>
authorGeoff Norton <grompf@sublimeintervention.com>
Fri, 23 Apr 2010 17:21:39 +0000 (17:21 -0000)
committerGeoff Norton <grompf@sublimeintervention.com>
Fri, 23 Apr 2010 17:21:39 +0000 (17:21 -0000)
* include/private/gcconfig.h: Darwin x86-64 bit support.
* darwin_stop_world.c: Ditto

svn path=/trunk/mono/; revision=156016

libgc/ChangeLog
libgc/darwin_stop_world.c
libgc/include/private/gcconfig.h

index 1b0db0230be361ded6f3923ca7a8fa405754631a..114a3b27551cc3e680cbccce59a7238950e25b93 100644 (file)
@@ -1,3 +1,8 @@
+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,
index 0c85c00572953ec063036bb3dbdcf0a641f3ad28..7e60fe790f53931eb85e99611c71f86a0a02757a 100644 (file)
@@ -89,6 +89,9 @@ void GC_push_all_stacks() {
 #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;
@@ -109,7 +112,7 @@ void GC_push_all_stacks() {
                             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
@@ -134,6 +137,29 @@ void GC_push_all_stacks() {
        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);
index 3d12de892322422989db8f04bba53bf820c5215a..10ffed637556ea6f90622b0e06e26b33eca7105f 100644 (file)
 #    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