diff options
| author | matt <matt@NetBSD.org> | 2003-08-31 19:45:25 +0000 |
|---|---|---|
| committer | matt <matt@NetBSD.org> | 2003-08-31 19:45:25 +0000 |
| commit | 9de4f868de49da9778243f6d3e65e6b4fba834bb (patch) | |
| tree | 051431a72323861395f7b31c8b52e9f2a57f2002 /gnu | |
| parent | 42dd9f2673a57f116b0e0ec63baee00f05f92c9f (diff) | |
Regenerated.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/lib/libstdc++-v3/arch/alpha/c++config.h | 10 | ||||
| -rw-r--r-- | gnu/lib/libstdc++-v3/arch/alpha/config.h | 8 | ||||
| -rw-r--r-- | gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h | 396 | ||||
| -rw-r--r-- | gnu/usr.bin/gcc3/arch/alpha/configargs.h | 4 | ||||
| -rw-r--r-- | gnu/usr.bin/gcc3/libiberty/defs.mk | 2 |
5 files changed, 351 insertions, 69 deletions
diff --git a/gnu/lib/libstdc++-v3/arch/alpha/c++config.h b/gnu/lib/libstdc++-v3/arch/alpha/c++config.h index 35ab19b808e..2219a372ce7 100644 --- a/gnu/lib/libstdc++-v3/arch/alpha/c++config.h +++ b/gnu/lib/libstdc++-v3/arch/alpha/c++config.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.1 2003/07/25 16:26:53 mrg Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp */ // Predefined symbols and macros -*- C++ -*- @@ -38,7 +38,7 @@ #include <bits/os_defines.h> // The current version of the C++ library in compressed ISO date format. -#define __GLIBCPP__ 20030720 +#define __GLIBCPP__ 20030804 // This is necessary until GCC supports separate template compilation. #define _GLIBCPP_NO_TEMPLATE_EXPORT 1 @@ -108,10 +108,10 @@ #define _GLIBCPP_HAVE_MMAP 1 // Define if GCC supports weak symbols. -/* #undef _GLIBCPP_SUPPORTS_WEAK */ +#define _GLIBCPP_SUPPORTS_WEAK __GXX_WEAK__ // Include I/O support for 'long long' and 'unsigned long long'. -/* #undef _GLIBCPP_USE_LONG_LONG */ +#define _GLIBCPP_USE_LONG_LONG 1 // Define if C99 features such as lldiv_t, llabs, lldiv should be exposed. /* #undef _GLIBCPP_USE_C99 */ @@ -140,7 +140,7 @@ #endif // Define if gthr-default.h exists (meaning that threading support is enabled). -/* #undef _GLIBCPP_HAVE_GTHR_DEFAULT */ +#define _GLIBCPP_HAVE_GTHR_DEFAULT 1 // Define if drand48 exists. /* #undef _GLIBCPP_HAVE_DRAND48 */ diff --git a/gnu/lib/libstdc++-v3/arch/alpha/config.h b/gnu/lib/libstdc++-v3/arch/alpha/config.h index aa7bb621f8a..15d43a042eb 100644 --- a/gnu/lib/libstdc++-v3/arch/alpha/config.h +++ b/gnu/lib/libstdc++-v3/arch/alpha/config.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.6 2003/08/01 02:44:56 mrg Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -8,10 +8,10 @@ #define HAVE_MMAP 1 // Define if GCC supports weak symbols. -/* #undef _GLIBCPP_SUPPORTS_WEAK */ +#define _GLIBCPP_SUPPORTS_WEAK __GXX_WEAK__ // Include I/O support for 'long long' and 'unsigned long long'. -/* #undef _GLIBCPP_USE_LONG_LONG */ +#define _GLIBCPP_USE_LONG_LONG 1 // Define if C99 features such as lldiv_t, llabs, lldiv should be exposed. /* #undef _GLIBCPP_USE_C99 */ @@ -40,7 +40,7 @@ #endif // Define if gthr-default.h exists (meaning that threading support is enabled). -/* #undef HAVE_GTHR_DEFAULT */ +#define HAVE_GTHR_DEFAULT 1 // Define if drand48 exists. /* #undef HAVE_DRAND48 */ diff --git a/gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h b/gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h index 6fa2b1ed699..6d49ac3e797 100644 --- a/gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h +++ b/gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.1 2003/07/25 16:26:53 mrg Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp */ /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GCC. @@ -29,22 +29,93 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ -#ifndef _GLIBCPP_GCC_GTHR_SINGLE_H -#define _GLIBCPP_GCC_GTHR_SINGLE_H +#ifndef _GLIBCPP_GCC_GTHR_POSIX_H +#define _GLIBCPP_GCC_GTHR_POSIX_H -/* Just provide compatibility for mutex handling. */ +/* POSIX threads specific definitions. + Easy, since the interface is just one-to-one mapping. */ -typedef int __gthread_mutex_t; +#define __GTHREADS 1 -#define __GTHREAD_MUTEX_INIT 0 +#include <pthread.h> +#include <unistd.h> -#ifdef __cplusplus -#define _GLIBCPP_UNUSED(x) -#else -#define _GLIBCPP_UNUSED(x) x __attribute__((unused)) -#endif +typedef pthread_key_t __gthread_key_t; +typedef pthread_once_t __gthread_once_t; +typedef pthread_mutex_t __gthread_mutex_t; + +#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER +#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT + +#if _GLIBCPP_SUPPORTS_WEAK && _GLIBCPP_GTHREAD_USE_WEAK + +#pragma weak pthread_once +#pragma weak pthread_key_create +#pragma weak pthread_key_delete +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific +#pragma weak pthread_create + +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_trylock +#pragma weak pthread_mutex_unlock #ifdef _LIBOBJC +/* Objective-C. */ +#pragma weak pthread_cond_broadcast +#pragma weak pthread_cond_destroy +#pragma weak pthread_cond_init +#pragma weak pthread_cond_signal +#pragma weak pthread_cond_wait +#pragma weak pthread_exit +#pragma weak pthread_mutex_init +#pragma weak pthread_mutex_destroy +#pragma weak pthread_self +/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but + we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */ +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +#pragma weak sched_get_priority_max +#pragma weak sched_get_priority_min +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +#pragma weak sched_yield +#pragma weak pthread_attr_destroy +#pragma weak pthread_attr_init +#pragma weak pthread_attr_setdetachstate +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +#pragma weak pthread_getschedparam +#pragma weak pthread_setschedparam +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +#endif /* _LIBOBJC */ + +static inline int +__gthread_active_p (void) +{ + static void *const __gthread_active_ptr = (void *) &pthread_create; + return __gthread_active_ptr != 0; +} + +#else /* not _GLIBCPP_SUPPORTS_WEAK */ + +static inline int +__gthread_active_p (void) +{ + return 1; +} + +#endif /* _GLIBCPP_SUPPORTS_WEAK */ + +#ifdef _LIBOBJC + +/* This is the config.h file in libobjc/ */ +#include <config.h> + +#ifdef HAVE_SCHED_H +# include <sched.h> +#endif + +/* Key structure for maintaining thread specific storage */ +static pthread_key_t _objc_thread_storage; +static pthread_attr_t _objc_thread_attribs; /* Thread local storage for a single thread */ static void *thread_local_storage = NULL; @@ -55,7 +126,21 @@ static void *thread_local_storage = NULL; static inline int __gthread_objc_init_thread_system (void) { - /* No thread support available */ + if (__gthread_active_p ()) + { + /* Initialize the thread storage key */ + if (pthread_key_create (&_objc_thread_storage, NULL) == 0) + { + /* The normal default detach state for threads is + * PTHREAD_CREATE_JOINABLE which causes threads to not die + * when you think they should. */ + if (pthread_attr_init (&_objc_thread_attribs) == 0 + && pthread_attr_setdetachstate (&_objc_thread_attribs, + PTHREAD_CREATE_DETACHED) == 0) + return 0; + } + } + return -1; } @@ -63,7 +148,11 @@ __gthread_objc_init_thread_system (void) static inline int __gthread_objc_close_thread_system (void) { - /* No thread support available */ + if (__gthread_active_p () + && pthread_key_delete (_objc_thread_storage) == 0 + && pthread_attr_destroy (&_objc_thread_attribs) == 0) + return 0; + return -1; } @@ -71,41 +160,100 @@ __gthread_objc_close_thread_system (void) /* Create a new thread of execution. */ static inline objc_thread_t -__gthread_objc_thread_detach (void (* func)(void *), void * _GLIBCPP_UNUSED(arg)) +__gthread_objc_thread_detach (void (*func)(void *), void *arg) { - /* No thread support available */ - return NULL; + objc_thread_t thread_id; + pthread_t new_thread_handle; + + if (!__gthread_active_p ()) + return NULL; + + if (!(pthread_create (&new_thread_handle, NULL, (void *) func, arg))) + thread_id = (objc_thread_t) new_thread_handle; + else + thread_id = NULL; + + return thread_id; } /* Set the current thread's priority. */ static inline int -__gthread_objc_thread_set_priority (int _GLIBCPP_UNUSED(priority)) +__gthread_objc_thread_set_priority (int priority) { - /* No thread support available */ - return -1; + if (!__gthread_active_p ()) + return -1; + else + { +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + pthread_t thread_id = pthread_self (); + int policy; + struct sched_param params; + int priority_min, priority_max; + + if (pthread_getschedparam (thread_id, &policy, ¶ms) == 0) + { + if ((priority_max = sched_get_priority_max (policy)) == -1) + return -1; + + if ((priority_min = sched_get_priority_min (policy)) == -1) + return -1; + + if (priority > priority_max) + priority = priority_max; + else if (priority < priority_min) + priority = priority_min; + params.sched_priority = priority; + + /* + * The solaris 7 and several other man pages incorrectly state that + * this should be a pointer to policy but pthread.h is universally + * at odds with this. + */ + if (pthread_setschedparam (thread_id, policy, ¶ms) == 0) + return 0; + } +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ + return -1; + } } /* Return the current thread's priority. */ static inline int __gthread_objc_thread_get_priority (void) { - return OBJC_THREAD_INTERACTIVE_PRIORITY; +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + if (__gthread_active_p ()) + { + int policy; + struct sched_param params; + + if (pthread_getschedparam (pthread_self (), &policy, ¶ms) == 0) + return params.sched_priority; + else + return -1; + } + else +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ + return OBJC_THREAD_INTERACTIVE_PRIORITY; } /* Yield our process time to another thread. */ static inline void __gthread_objc_thread_yield (void) { - return; + if (__gthread_active_p ()) + sched_yield (); } /* Terminate the current thread. */ static inline int __gthread_objc_thread_exit (void) { - /* No thread support available */ - /* Should we really exit the program */ - /* exit (&__objc_thread_exit_status); */ + if (__gthread_active_p ()) + /* exit the thread */ + pthread_exit (&__objc_thread_exit_status); + + /* Failed if we reached here */ return -1; } @@ -113,61 +261,122 @@ __gthread_objc_thread_exit (void) static inline objc_thread_t __gthread_objc_thread_id (void) { - /* No thread support, use 1. */ - return (objc_thread_t) 1; + if (__gthread_active_p ()) + return (objc_thread_t) pthread_self (); + else + return (objc_thread_t) 1; } /* Sets the thread's local storage pointer. */ static inline int __gthread_objc_thread_set_data (void *value) { - thread_local_storage = value; - return 0; + if (__gthread_active_p ()) + return pthread_setspecific (_objc_thread_storage, value); + else + { + thread_local_storage = value; + return 0; + } } /* Returns the thread's local storage pointer. */ static inline void * __gthread_objc_thread_get_data (void) { - return thread_local_storage; + if (__gthread_active_p ()) + return pthread_getspecific (_objc_thread_storage); + else + return thread_local_storage; } /* Backend mutex functions */ /* Allocate a mutex. */ static inline int -__gthread_objc_mutex_allocate (objc_mutex_t _GLIBCPP_UNUSED(mutex)) +__gthread_objc_mutex_allocate (objc_mutex_t mutex) { + if (__gthread_active_p ()) + { + mutex->backend = objc_malloc (sizeof (pthread_mutex_t)); + + if (pthread_mutex_init ((pthread_mutex_t *) mutex->backend, NULL)) + { + objc_free (mutex->backend); + mutex->backend = NULL; + return -1; + } + } + return 0; } /* Deallocate a mutex. */ static inline int -__gthread_objc_mutex_deallocate (objc_mutex_t _GLIBCPP_UNUSED(mutex)) +__gthread_objc_mutex_deallocate (objc_mutex_t mutex) { + if (__gthread_active_p ()) + { + int count; + + /* + * Posix Threads specifically require that the thread be unlocked + * for pthread_mutex_destroy to work. + */ + + do + { + count = pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend); + if (count < 0) + return -1; + } + while (count); + + if (pthread_mutex_destroy ((pthread_mutex_t *) mutex->backend)) + return -1; + + objc_free (mutex->backend); + mutex->backend = NULL; + } return 0; } /* Grab a lock on a mutex. */ static inline int -__gthread_objc_mutex_lock (objc_mutex_t _GLIBCPP_UNUSED(mutex)) +__gthread_objc_mutex_lock (objc_mutex_t mutex) { - /* There can only be one thread, so we always get the lock */ + if (__gthread_active_p () + && pthread_mutex_lock ((pthread_mutex_t *) mutex->backend) != 0) + { + return -1; + } + return 0; } /* Try to grab a lock on a mutex. */ static inline int -__gthread_objc_mutex_trylock (objc_mutex_t _GLIBCPP_UNUSED(mutex)) +__gthread_objc_mutex_trylock (objc_mutex_t mutex) { - /* There can only be one thread, so we always get the lock */ + if (__gthread_active_p () + && pthread_mutex_trylock ((pthread_mutex_t *) mutex->backend) != 0) + { + return -1; + } + return 0; } /* Unlock the mutex */ static inline int -__gthread_objc_mutex_unlock (objc_mutex_t _GLIBCPP_UNUSED(mutex)) +__gthread_objc_mutex_unlock (objc_mutex_t mutex) { + if (__gthread_active_p () + && pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend) != 0) + { + return -1; + } + return 0; } @@ -175,68 +384,141 @@ __gthread_objc_mutex_unlock (objc_mutex_t _GLIBCPP_UNUSED(mutex)) /* Allocate a condition. */ static inline int -__gthread_objc_condition_allocate (objc_condition_t _GLIBCPP_UNUSED(condition)) +__gthread_objc_condition_allocate (objc_condition_t condition) { + if (__gthread_active_p ()) + { + condition->backend = objc_malloc (sizeof (pthread_cond_t)); + + if (pthread_cond_init ((pthread_cond_t *) condition->backend, NULL)) + { + objc_free (condition->backend); + condition->backend = NULL; + return -1; + } + } + return 0; } /* Deallocate a condition. */ static inline int -__gthread_objc_condition_deallocate (objc_condition_t _GLIBCPP_UNUSED(condition)) +__gthread_objc_condition_deallocate (objc_condition_t condition) { + if (__gthread_active_p ()) + { + if (pthread_cond_destroy ((pthread_cond_t *) condition->backend)) + return -1; + + objc_free (condition->backend); + condition->backend = NULL; + } return 0; } /* Wait on the condition */ static inline int -__gthread_objc_condition_wait (objc_condition_t _GLIBCPP_UNUSED(condition), - objc_mutex_t _GLIBCPP_UNUSED(mutex)) +__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex) { - return 0; + if (__gthread_active_p ()) + return pthread_cond_wait ((pthread_cond_t *) condition->backend, + (pthread_mutex_t *) mutex->backend); + else + return 0; } /* Wake up all threads waiting on this condition. */ static inline int -__gthread_objc_condition_broadcast (objc_condition_t _GLIBCPP_UNUSED(condition)) +__gthread_objc_condition_broadcast (objc_condition_t condition) { - return 0; + if (__gthread_active_p ()) + return pthread_cond_broadcast ((pthread_cond_t *) condition->backend); + else + return 0; } /* Wake up one thread waiting on this condition. */ static inline int -__gthread_objc_condition_signal (objc_condition_t _GLIBCPP_UNUSED(condition)) +__gthread_objc_condition_signal (objc_condition_t condition) { - return 0; + if (__gthread_active_p ()) + return pthread_cond_signal ((pthread_cond_t *) condition->backend); + else + return 0; } #else /* _LIBOBJC */ static inline int -__gthread_active_p (void) +__gthread_once (__gthread_once_t *once, void (*func) (void)) { - return 0; + if (__gthread_active_p ()) + return pthread_once (once, func); + else + return -1; } static inline int -__gthread_mutex_lock (__gthread_mutex_t * _GLIBCPP_UNUSED(mutex)) +__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) { - return 0; + return pthread_key_create (key, dtor); } static inline int -__gthread_mutex_trylock (__gthread_mutex_t * _GLIBCPP_UNUSED(mutex)) +__gthread_key_dtor (__gthread_key_t key, void *ptr) { - return 0; + /* Just reset the key value to zero. */ + if (ptr) + return pthread_setspecific (key, 0); + else + return 0; } static inline int -__gthread_mutex_unlock (__gthread_mutex_t * _GLIBCPP_UNUSED(mutex)) +__gthread_key_delete (__gthread_key_t key) { - return 0; + return pthread_key_delete (key); } -#endif /* _LIBOBJC */ +static inline void * +__gthread_getspecific (__gthread_key_t key) +{ + return pthread_getspecific (key); +} -#undef _GLIBCPP_UNUSED +static inline int +__gthread_setspecific (__gthread_key_t key, const void *ptr) +{ + return pthread_setspecific (key, ptr); +} + +static inline int +__gthread_mutex_lock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return pthread_mutex_lock (mutex); + else + return 0; +} + +static inline int +__gthread_mutex_trylock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return pthread_mutex_trylock (mutex); + else + return 0; +} + +static inline int +__gthread_mutex_unlock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return pthread_mutex_unlock (mutex); + else + return 0; +} + +#endif /* _LIBOBJC */ -#endif /* ! _GLIBCPP_GCC_GTHR_SINGLE_H */ +#endif /* ! _GLIBCPP_GCC_GTHR_POSIX_H */ diff --git a/gnu/usr.bin/gcc3/arch/alpha/configargs.h b/gnu/usr.bin/gcc3/arch/alpha/configargs.h index 2f11098717e..3155b185b30 100644 --- a/gnu/usr.bin/gcc3/arch/alpha/configargs.h +++ b/gnu/usr.bin/gcc3/arch/alpha/configargs.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.5 2003/07/30 05:10:06 mrg Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp */ /* Generated automatically. */ -static const char configuration_arguments[] = "/usr/src/tools/gcc/../../gnu/dist/gcc/configure --disable-multilib --enable-threads --build=alpha-unknown-netbsd --host=alpha--netbsd --target=alpha--netbsd"; +static const char configuration_arguments[] = "/usr/src/tools/gcc/../../gnu/dist/gcc/configure --enable-long-long --disable-multilib --enable-threads --build=alpha-unknown-netbsd --host=alpha--netbsd --target=alpha--netbsd"; static const char thread_model[] = "posix"; diff --git a/gnu/usr.bin/gcc3/libiberty/defs.mk b/gnu/usr.bin/gcc3/libiberty/defs.mk index df56e6bd2e3..800477ef127 100644 --- a/gnu/usr.bin/gcc3/libiberty/defs.mk +++ b/gnu/usr.bin/gcc3/libiberty/defs.mk @@ -3,5 +3,5 @@ # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=insque.o mkstemps.o strncmp.o +G_LIBOBJS=insque.o mkstemps.o G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o alloca.o argv.o choose-temp.o concat.o dyn-string.o fdmatch.o fibheap.o floatformat.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o physmem.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o strerror.o strsignal.o ternary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o |
