OSDN Git Service

2007-01-11 Andreas Tobler <a.tobler@schweiz.org>
[pf3gnuchains/gcc-fork.git] / boehm-gc / os_dep.c
index 98ab6be..5a0e59f 100644 (file)
@@ -3683,7 +3683,7 @@ void GC_dirty_init() {
         mask,
         GC_ports.exception,
         EXCEPTION_DEFAULT,
-        MACHINE_THREAD_STATE
+        GC_MACH_THREAD_STATE
     );
     if(r != KERN_SUCCESS) ABORT("task_set_exception_ports failed");
 
@@ -3802,10 +3802,16 @@ catch_exception_raise(
         mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
         ppc_exception_state64_t exc_state;
 #     endif
-#   elif defined(I386)
-        thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
-        mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
-        i386_exception_state_t exc_state;
+#   elif defined(I386) || defined(X86_64)
+#     if CPP_WORDSZ == 32
+       thread_state_flavor_t flavor = x86_EXCEPTION_STATE32;
+       mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE32_COUNT;
+       x86_exception_state_t exc_state;
+#     else
+       thread_state_flavor_t flavor = x86_EXCEPTION_STATE64;
+       mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE64_COUNT;
+       x86_exception_state64_t exc_state;
+#     endif
 #   else
 #      error FIXME for non-ppc darwin
 #   endif
@@ -3839,7 +3845,7 @@ catch_exception_raise(
     /* This is the address that caused the fault */
 #if defined(POWERPC)
     addr = (char*) exc_state.dar;
-#elif defined (I386)
+#elif defined (I386) || defined (X86_64)
     addr = (char*) exc_state.faultvaddr;
 #else
 #   error FIXME for non POWERPC/I386