]> granicus.if.org Git - gc/commitdiff
2007-01-25 Andreas Tobler <a.tobler@schweiz.org>
authora_tobler <a_tobler>
Thu, 25 Jan 2007 05:18:27 +0000 (05:18 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:39 +0000 (21:06 +0400)
* darwin_stop_world.c: Move THREAD_FLD defines to ...
* include/private/gc_priv.h: ... here.
Fix THREAD_STATE definitions for ppc64.
* os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
access.

ChangeLog
darwin_stop_world.c
include/private/gc_priv.h
os_dep.c

index 357ad529c7887df80c441a0c135c0efaab597b04..35094fc642623d37bbacebb0acd3b536650ef4d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-25  Andreas Tobler  <a.tobler@schweiz.org>
+
+       * darwin_stop_world.c: Move THREAD_FLD defines to ...
+       * include/private/gc_priv.h: ... here.
+       Fix THREAD_STATE definitions for ppc64.
+       * os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
+       access.
+
 2007-01-18  Andreas Tobler  <a.tobler@schweiz.org>
 
        * os_dep.c (if defined(MPROTECT_VDB) && defined(DARWIN)): Clean up and
index 63ec54d60ddd466b899dcc0aac77c10ffdec46bd..998158786a6cfdc651145b1b43a4583c464055f1 100644 (file)
 # endif
 #endif
 
-/* Try to work out the right way to access thread state structure members.
-   The structure has changed its definition in different Darwin versions.  */
-/* This now defaults to the (older) names without __, thus hopefully   */
-/* not breaking any existing Makefile.direct builds.                   */
-#if defined (HAS_PPC_THREAD_STATE___R0) ||     \
-    defined (HAS_PPC_THREAD_STATE64___R0) ||   \
-    defined (HAS_X86_THREAD_STATE32___EAX) ||  \
-    defined (HAS_X86_THREAD_STATE64___RAX)
-#  define THREAD_FLD(x) __ ## x
-#else
-#  define THREAD_FLD(x) x
-#endif
 
 typedef struct StackFrame {
   unsigned long        savedSP;
index cf70cf746325a6c1b9c09222e2cb561b19ba8488..b495bd51ef35a2c781112dc7eec4494d4f4a9682 100644 (file)
@@ -367,15 +367,17 @@ extern GC_warn_proc GC_current_warn_proc;
 #      if defined(POWERPC)
 #              if CPP_WORDSZ == 32
 #                 define GC_THREAD_STATE_T ppc_thread_state_t
+#                define GC_MACH_THREAD_STATE PPC_THREAD_STATE
+#                define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
 #                define GC_MACH_HEADER mach_header
 #                define GC_MACH_SECTION section
 #              else
 #                 define GC_THREAD_STATE_T ppc_thread_state64_t
+#                define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
+#                define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
 #                define GC_MACH_HEADER mach_header_64
 #                define GC_MACH_SECTION section_64
 #              endif
-#              define GC_MACH_THREAD_STATE PPC_THREAD_STATE
-#              define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
 #      elif defined(I386) || defined(X86_64)
 #               if CPP_WORDSZ == 32
 #                define GC_THREAD_STATE_T x86_thread_state32_t
@@ -395,6 +397,18 @@ extern GC_warn_proc GC_current_warn_proc;
 #              define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
 #              define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
 #      endif
+/* Try to work out the right way to access thread state structure members.
+   The structure has changed its definition in different Darwin versions.
+   This now defaults to the (older) names without __, thus hopefully,
+   not breaking any existing Makefile.direct builds.  */
+#       if defined (HAS_PPC_THREAD_STATE___R0) \
+         || defined (HAS_PPC_THREAD_STATE64___R0) \
+         || defined (HAS_X86_THREAD_STATE32___EAX) \
+         || defined (HAS_X86_THREAD_STATE64___RAX)
+#         define THREAD_FLD(x) __ ## x
+#       else
+#         define THREAD_FLD(x) x
+#       endif
 #endif
 
 /*********************************/
index b6501c57e7235c75e9bbaceb6bfd243761e263dc..9a31b1896c10406350373d6c2594c4cc48df338c 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -3895,9 +3895,9 @@ catch_exception_raise(mach_port_t exception_port, mach_port_t thread,
 
     /* This is the address that caused the fault */
 # if defined(POWERPC)
-    addr = (char*) exc_state.dar;
+    addr = (char*) exc_state. THREAD_FLD(dar);
 # elif defined (I386) || defined (X86_64)
-    addr = (char*) exc_state.faultvaddr;
+    addr = (char*) exc_state. THREAD_FLD(faultvaddr);
 # else
 #   error FIXME for non POWERPC/I386
 # endif