From: Geoff Norton Date: Thu, 1 Feb 2007 16:08:59 +0000 (+0000) Subject: 2007-02-01 Geoff Norton X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bee0610fc35b4d28cb7d9b8ae91f23f035a7a8e1;p=gc 2007-02-01 Geoff Norton * include/private/gc_pthread_redirects.h: * include/private/gc_config_macros.h: * include/private/gc_priv.h: * configure.in: * pthread_support.c * specific.c: Support for NetBSD-CURRENT. Loosely based on NetBSD pkgsrc patch. svn path=/trunk/mono/; revision=72097 --- diff --git a/ChangeLog b/ChangeLog index 0b800d82..dc5e6fd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-02-01 Geoff Norton + + * include/private/gc_pthread_redirects.h: + * include/private/gc_config_macros.h: + * include/private/gc_priv.h: + * configure.in: + * pthread_support.c + * specific.c: Support for NetBSD-CURRENT. Loosely based on NetBSD + pkgsrc patch. + 2006-12-22 Robert Jordan * include/private/gcconfig.h, os_dep.c: diff --git a/configure.in b/configure.in index 96acc156..6fcf1ace 100644 --- a/configure.in +++ b/configure.in @@ -151,6 +151,13 @@ case "$THREADS" in AC_DEFINE(PARALLEL_MARK) fi ;; + *-*-netbsd*) + AC_DEFINE(GC_NETBSD_THREADS) + if test "${enable_parallel_mark}" = yes; then + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + ;; *-*-osf*) AC_DEFINE(GC_OSF1_THREADS) if test "${enable_parallel_mark}" = yes; then diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index 4671864b..d8f38303 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -56,7 +56,7 @@ defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \ defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \ defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \ - defined(GC_AIX_THREADS) || \ + defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \ (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__)) # define GC_PTHREADS # endif diff --git a/include/gc_pthread_redirects.h b/include/gc_pthread_redirects.h index f42b0f6a..bedcc26a 100644 --- a/include/gc_pthread_redirects.h +++ b/include/gc_pthread_redirects.h @@ -74,7 +74,10 @@ # define pthread_join GC_pthread_join # define pthread_detach GC_pthread_detach -#ifndef GC_DARWIN_THREADS +#ifndef GC_DARWIN_THREADS +# ifdef GC_NETBSD_THREADS +# undef pthread_sigmask +# endif # define pthread_sigmask GC_pthread_sigmask # define dlopen GC_dlopen #endif diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index cc0410d4..0e978ea9 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1956,7 +1956,7 @@ void GC_err_puts GC_PROTO((GC_CONST char *s)); /* in Linux glibc, but it's not exported.) Thus we continue to use */ /* the same hard-coded signals we've always used. */ # if !defined(SIG_SUSPEND) -# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS) +# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS) || defined(GC_NETBSD_THREADS) # if defined(SPARC) && !defined(SIGPWR) /* SPARC/Linux doesn't properly define SIGPWR in . * It is aliased to SIGLOST in asm/signal.h, though. */ diff --git a/pthread_support.c b/pthread_support.c index 0346a802..68084bd6 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -67,8 +67,8 @@ # endif # if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \ - defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \ - && !defined(USE_PTHREAD_SPECIFIC) + defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) || \ + defined(GC_NETBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC) # define USE_PTHREAD_SPECIFIC # endif @@ -126,6 +126,11 @@ # include #endif /* GC_DARWIN_THREADS */ +#if defined(GC_NETBSD_THREADS) +# include +# include +#endif + #if defined(GC_DGUX386_THREADS) @@ -1013,7 +1018,7 @@ void GC_thr_init() GC_nprocs = sysconf(_SC_NPROC_ONLN); if (GC_nprocs <= 0) GC_nprocs = 1; # endif -# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) +# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) || defined(GC_NETBSD_THREADS) int ncpus = 1; size_t len = sizeof(ncpus); sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0); diff --git a/specific.c b/specific.c index 7d5d8894..0de67ffd 100644 --- a/specific.c +++ b/specific.c @@ -13,7 +13,7 @@ #include "private/gc_priv.h" /* For GC_compare_and_exchange, GC_memory_barrier */ -#if defined(GC_LINUX_THREADS) +#if defined(GC_LINUX_THREADS) || defined(GC_NETBSD_THREADS) #include "private/specific.h"