aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/include
diff options
context:
space:
mode:
authorAndreas Tobler <a.tobler@schweiz.org>2007-01-11 20:06:45 +0000
committerAndreas Tobler <andreast@gcc.gnu.org>2007-01-11 21:06:45 +0100
commit583cb3d38f9c3a1b93938dd851e48af24827626d (patch)
tree702d33aaf045d9f70bceb0e22f3ef4a3727a2ddf /boehm-gc/include
parent6f9f76e336e9ce7a1c070351e4d21e6b84c0e82c (diff)
downloadgcc-583cb3d38f9c3a1b93938dd851e48af24827626d.zip
gcc-583cb3d38f9c3a1b93938dd851e48af24827626d.tar.gz
gcc-583cb3d38f9c3a1b93938dd851e48af24827626d.tar.bz2
configure.ac: Replaced HAS_I386_THREAD_STATE_* with HAS_X86_THREAD_STATE32_* and...
2007-01-11 Andreas Tobler <a.tobler@schweiz.org> * configure.ac: Replaced HAS_I386_THREAD_STATE_* with HAS_X86_THREAD_STATE32_* and HAS_X86_THREAD_STATE64_* respectively. * configure: Regenerated. * include/private/gcconfig.h (DARWIN): Added X86_64 define for Darwin. Added base definitions for the X86_64 Darwin port. * include/private/gc_priv.h: Added definitions for Darwin MACH thread operations. Moved existing THREAD_STATE info from darwin_stop_world.c. * darwin_stop_world.c: Removed THREAD_STATE info. Added HAS_X86_THREAD_STATE64___RAX. And replaced HAS_I386_THREAD_STATE___EAX with HAS_X86_THREAD_STATE32___EAX. (GC_push_all_stacks): Use GC_MACH_THREAD_STATE_COUNT. Add code for X86_64 Darwin. * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER. (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION. Distinguish between getsectbynamefromheader_64 and getsectbynamefromheader. (GC_dyld_image_remove): Likewise. * os_dep.c (GC_dirty_init): Use GC_MACH_THREAD_STATE. (catch_exception_raise): Introduce exception information for I386 and X86_64 Darwin. Add X86_64 for exc_state.faultvaddr. From-SVN: r120684
Diffstat (limited to 'boehm-gc/include')
-rw-r--r--boehm-gc/include/private/gc_priv.h33
-rw-r--r--boehm-gc/include/private/gcconfig.h45
2 files changed, 68 insertions, 10 deletions
diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h
index 38685bc..f72faf9 100644
--- a/boehm-gc/include/private/gc_priv.h
+++ b/boehm-gc/include/private/gc_priv.h
@@ -468,6 +468,39 @@ extern GC_warn_proc GC_current_warn_proc;
# define GETENV(name) 0
#endif
+#if defined(DARWIN)
+# if defined(POWERPC)
+# if CPP_WORDSZ == 32
+# define GC_THREAD_STATE_T ppc_thread_state_t
+# define GC_MACH_HEADER mach_header
+# define GC_MACH_SECTION section
+# else
+# define GC_THREAD_STATE_T ppc_thread_state64_t
+# 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
+# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
+# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
+# define GC_MACH_HEADER mach_header
+# define GC_MACH_SECTION section
+# else
+# define GC_THREAD_STATE_T x86_thread_state64_t
+# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
+# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
+# define GC_MACH_HEADER mach_header_64
+# define GC_MACH_SECTION section_64
+# endif
+# else
+# error define GC_THREAD_STATE_T
+# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
+# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
+# endif
+#endif
/*********************************/
/* */
/* Word-size-dependent defines */
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index e06a756..ef22232 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -302,7 +302,10 @@
# if defined(__ppc__) || defined(__ppc64__)
# define POWERPC
# define mach_type_known
-# elif defined(__i386__) || defined(__x86_64)
+# elif defined(__x86_64__)
+# define X86_64
+# define mach_type_known
+# elif defined(__i386__)
# define I386
# define mach_type_known
# endif
@@ -787,7 +790,7 @@
# define DATAEND (_end)
# endif
# ifdef DARWIN
-# if defined(__ppc64__) || defined(__x86_64)
+# if defined(__ppc64__)
# define ALIGNMENT 8
# define CPP_WORDSZ 64
# else
@@ -796,7 +799,7 @@
# define OS_TYPE "DARWIN"
# 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) */
+ 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) 0xc0000000)
@@ -804,9 +807,9 @@
# define USE_MMAP_ANON
# define USE_ASM_PUSH_REGS
/* This is potentially buggy. It needs more testing. See the comments in
- os_dep.c. It relies on threads to track writes. */
+ os_dep.c. It relies on threads to track writes. */
# ifdef GC_DARWIN_THREADS
-/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
+/*# define MPROTECT_VDB -- diabled for now. May work for some apps. */
# endif
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
@@ -818,7 +821,7 @@
__asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))
# endif
/* There seems to be some issues with trylock hanging on darwin. This
- should be looked into some more */
+ should be looked into some more */
# define NO_PTHREAD_TRYLOCK
# endif
# ifdef FREEBSD
@@ -1313,7 +1316,7 @@
# 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) */
+ 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) 0xc0000000)
@@ -1321,15 +1324,15 @@
# define USE_MMAP_ANON
# define USE_ASM_PUSH_REGS
/* This is potentially buggy. It needs more testing. See the comments in
- os_dep.c. It relies on threads to track writes. */
+ os_dep.c. It relies on threads to track writes. */
# ifdef GC_DARWIN_THREADS
/* # define MPROTECT_VDB -- disabled for now. May work for some apps. */
# 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 */
-# define NO_PTHREAD_TRYLOCK
+ should be looked into some more */
+# define NO_PTHREAD_TRYLOCK
# endif /* DARWIN */
# endif
@@ -1982,6 +1985,28 @@
# 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)
+# define USE_MMAP
+# define USE_MMAP_ANON
+# ifdef GC_DARWIN_THREADS
+ /* This is potentially buggy. It needs more testing. See the comments in
+ os_dep.c. It relies on threads to track writes. */
+# 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 */
+# define NO_PTHREAD_TRYLOCK
+# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# ifndef GC_FREEBSD_THREADS