diff options
-rw-r--r-- | elf/soinit.c | 14 | ||||
-rw-r--r-- | linuxthreads/ChangeLog | 4 | ||||
-rw-r--r-- | linuxthreads/mutex.c | 2 | ||||
-rw-r--r-- | manual/errno.texi | 2 | ||||
-rw-r--r-- | math/Makefile | 1 | ||||
-rw-r--r-- | math/test-fenv.c | 18 | ||||
-rw-r--r-- | string/bits/string2.h | 2 | ||||
-rw-r--r-- | sysdeps/generic/gccframe.h | 30 | ||||
-rw-r--r-- | sysdeps/gnu/errlist.c | 2 | ||||
-rw-r--r-- | sysdeps/ia64/bits/fenv.h | 4 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/fclrexcpt.c | 2 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/fedisblxcpt.c | 2 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/feenablxcpt.c | 3 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/fesetenv.c | 4 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/fesetround.c | 4 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/fgetexcptflg.c | 2 | ||||
-rw-r--r-- | sysdeps/ia64/fpu/fsetexcptflg.c | 7 | ||||
-rw-r--r-- | sysdeps/ia64/gccframe.h | 32 |
18 files changed, 105 insertions, 30 deletions
diff --git a/elf/soinit.c b/elf/soinit.c index 3cb5584f6c..4e2a149d86 100644 --- a/elf/soinit.c +++ b/elf/soinit.c @@ -3,6 +3,10 @@ the `.ctors' and `.dtors' sections so the lists are terminated, and calling those lists of functions. */ +# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC +# include <gccframe.h> +# endif + static void (*const __CTOR_LIST__[1]) (void) __attribute__ ((section (".ctors"))) = { (void (*) (void)) -1 }; @@ -22,16 +26,6 @@ static char __EH_FRAME_BEGIN__[] __attribute__ ((section (".eh_frame"))) = { }; # ifdef HAVE_DWARF2_UNWIND_INFO_STATIC -/* This must match what's in frame.h in gcc. How can one do that? */ -struct object -{ - void *pc_begin; - void *pc_end; - void *fde_begin; - void *fde_array; - __SIZE_TYPE__ count; - struct object *next; -}; extern void __register_frame_info (const void *, struct object *); extern void __deregister_frame_info (const void *); # else diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 90458288e9..4c281da24a 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,5 +1,9 @@ 2000-09-28 Ulrich Drepper <drepper@redhat.com> + * mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP + test for owner first. + Patch by Kaz Kylheku <kaz@ashi.footprints.net>. + * cancel.c (pthread_cancel): Don't do anything if cancelation is disabled. diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c index 9ce4a30820..9b4a3c7f56 100644 --- a/linuxthreads/mutex.c +++ b/linuxthreads/mutex.c @@ -163,6 +163,8 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex) __pthread_unlock(&mutex->__m_lock); return 0; case PTHREAD_MUTEX_RECURSIVE_NP: + if (mutex->__m_owner != thread_self()) + return EPERM; if (mutex->__m_count > 0) { mutex->__m_count--; return 0; diff --git a/manual/errno.texi b/manual/errno.texi index 8b18c83bec..5abb823bbd 100644 --- a/manual/errno.texi +++ b/manual/errno.texi @@ -162,7 +162,7 @@ Input/output error; usually used for physical read or write errors. @end deftypevr @comment errno.h -@comment POSIX.1: Device not configured +@comment POSIX.1: No such device or address @deftypevr Macro int ENXIO @comment errno 6 @c DO NOT REMOVE No such device or address. The system tried to use the device diff --git a/math/Makefile b/math/Makefile index 45df416a1f..2e240197a5 100644 --- a/math/Makefile +++ b/math/Makefile @@ -83,6 +83,7 @@ tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ # We do the `long double' tests only if this data type is available and # distinct from `double'. test-longdouble-yes = test-ldouble test-ildoubl +distribute += $(test-longdouble-yes:=.c) ifneq (no,$(PERL)) libm-tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \ diff --git a/math/test-fenv.c b/math/test-fenv.c index d803f27808..c369fc0aaa 100644 --- a/math/test-fenv.c +++ b/math/test-fenv.c @@ -400,6 +400,7 @@ static void feexcp_mask_test (const char *flag_name, int fe_exc) { int status; + int exception; pid_t pid; printf ("Test: after fedisable (%s) processes will not abort\n", flag_name); @@ -415,7 +416,22 @@ feexcp_mask_test (const char *flag_name, int fe_exc) setrlimit (RLIMIT_CORE, &core_limit); #endif feenableexcept (FE_ALL_EXCEPT); - fedisableexcept (fe_exc); + exception = fe_exc; +#ifdef FE_INEXACT + /* The standard allows the inexact exception to be set together with the + underflow and overflow exceptions. So add FE_INEXACT to the set of + exceptions to be disabled if we will be raising underflow or + overflow. */ +# ifdef FE_OVERFLOW + if (fe_exc & FE_OVERFLOW) + exception |= FE_INEXACT; +# endif +# ifdef FE_UNDERFLOW + if (fe_exc & FE_UNDERFLOW) + exception |= FE_INEXACT; +# endif +#endif + fedisableexcept (exception); feraiseexcept (fe_exc); exit (2); } diff --git a/string/bits/string2.h b/string/bits/string2.h index 897b5d5b24..de427f8cb4 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -22,7 +22,7 @@ # error "Never use <bits/string2.h> directly; include <string.h> instead." #endif -#if !defined __NO_STRING_INLINES && !__BOUNDED_POINTERS__ +#if !defined __NO_STRING_INLINES && !defined __BOUNDED_POINTERS__ /* Unlike the definitions in the header <bits/string.h> the definitions contained here are not optimized down to assembler diff --git a/sysdeps/generic/gccframe.h b/sysdeps/generic/gccframe.h new file mode 100644 index 0000000000..6ed932017a --- /dev/null +++ b/sysdeps/generic/gccframe.h @@ -0,0 +1,30 @@ +/* Definition of object in frame unwind info. Generic version. + Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This must match what's in frame.h in gcc. */ + +struct object +{ + void *pc_begin; + void *pc_end; + void *fde_begin; + void *fde_array; + __SIZE_TYPE__ count; + struct object *next; +}; diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c index 4c635d2b97..1b15c5e3a9 100644 --- a/sysdeps/gnu/errlist.c +++ b/sysdeps/gnu/errlist.c @@ -59,7 +59,7 @@ TRANS represented by a file you specified, and it couldn't find the device. TRANS This can mean that the device file was installed incorrectly, or that TRANS the physical device is missing or not correctly attached to the TRANS computer. */ - [ERR_REMAP (ENXIO)] = N_("Device not configured"), + [ERR_REMAP (ENXIO)] = N_("No such device or address"), #endif #ifdef E2BIG /* diff --git a/sysdeps/ia64/bits/fenv.h b/sysdeps/ia64/bits/fenv.h index 9c3bd476e3..783fc9bff2 100644 --- a/sysdeps/ia64/bits/fenv.h +++ b/sysdeps/ia64/bits/fenv.h @@ -67,10 +67,10 @@ enum /* Type representing exception flags. */ -typedef unsigned long fexcept_t; +typedef unsigned long int fexcept_t; /* Type representing floating-point environment. */ -typedef unsigned long fenv_t; +typedef unsigned long int fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((__const fenv_t *) 0xc009804c0270033fUL) diff --git a/sysdeps/ia64/fpu/fclrexcpt.c b/sysdeps/ia64/fpu/fclrexcpt.c index fbd93ce5da..40ba1792ed 100644 --- a/sysdeps/ia64/fpu/fclrexcpt.c +++ b/sysdeps/ia64/fpu/fclrexcpt.c @@ -30,7 +30,7 @@ feclearexcept (int excepts) __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr)); /* Clear the relevant bits. */ - fpsr &= ~(((unsigned long int) ((excepts & FE_ALL_EXCEPT) << 13))); + fpsr &= ~(((fenv_t) ((excepts & FE_ALL_EXCEPT) << 13))); /* Put the new state in effect. */ __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory"); diff --git a/sysdeps/ia64/fpu/fedisblxcpt.c b/sysdeps/ia64/fpu/fedisblxcpt.c index fceedc22be..1006e033e5 100644 --- a/sysdeps/ia64/fpu/fedisblxcpt.c +++ b/sysdeps/ia64/fpu/fedisblxcpt.c @@ -29,7 +29,7 @@ fedisableexcept (int excepts) /* Get the current fpsr. */ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (old_fpsr)); - new_fpsr = old_fpsr |= FE_ALL_EXCEPT; + new_fpsr = old_fpsr | ((fenv_t) excepts & FE_ALL_EXCEPT); __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (new_fpsr) : "memory"); diff --git a/sysdeps/ia64/fpu/feenablxcpt.c b/sysdeps/ia64/fpu/feenablxcpt.c index 2c54476681..686b7505cc 100644 --- a/sysdeps/ia64/fpu/feenablxcpt.c +++ b/sysdeps/ia64/fpu/feenablxcpt.c @@ -29,8 +29,7 @@ feenableexcept (int excepts) /* Get the current fpsr. */ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r " (old_fpsr)); - new_fpsr = ((old_fpsr & FE_ALL_EXCEPT) - | (old_fpsr & ((unsigned long int) excepts ^ FE_ALL_EXCEPT))); + new_fpsr = old_fpsr & ~((fenv_t) excepts & FE_ALL_EXCEPT); __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (new_fpsr) : "memory"); diff --git a/sysdeps/ia64/fpu/fesetenv.c b/sysdeps/ia64/fpu/fesetenv.c index b1209ca34e..79651ea1ce 100644 --- a/sysdeps/ia64/fpu/fesetenv.c +++ b/sysdeps/ia64/fpu/fesetenv.c @@ -30,8 +30,8 @@ fesetenv (const fenv_t *envp) Magic encoding of default values: bit 62+63 set (which will never happen for a user-space address) means it's not indirect. */ - if (((unsigned long int) envp >> 62) == 0x03) - env = (unsigned long int) envp & 0x3fffffffffffffff; + if (((fenv_t) envp >> 62) == 0x03) + env = (fenv_t) envp & 0x3fffffffffffffff; else env = *envp; diff --git a/sysdeps/ia64/fpu/fesetround.c b/sysdeps/ia64/fpu/fesetround.c index 66d7f89f39..7738eb209e 100644 --- a/sysdeps/ia64/fpu/fesetround.c +++ b/sysdeps/ia64/fpu/fesetround.c @@ -23,7 +23,7 @@ int fesetround (int round) { - unsigned long int fpsr; + fenv_t fpsr; if (round & ~3) return 0; @@ -32,7 +32,7 @@ fesetround (int round) __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr)); /* Set the relevant bits. */ - fpsr = (fpsr & ~(3UL << 10)) | ((unsigned long int) round << 10); + fpsr = (fpsr & ~(3UL << 10)) | ((fenv_t) round << 10); /* Put the new state in effect. */ __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory"); diff --git a/sysdeps/ia64/fpu/fgetexcptflg.c b/sysdeps/ia64/fpu/fgetexcptflg.c index 555530762d..46a04e3f2c 100644 --- a/sysdeps/ia64/fpu/fgetexcptflg.c +++ b/sysdeps/ia64/fpu/fgetexcptflg.c @@ -28,7 +28,7 @@ fegetexceptflag (fexcept_t *flagp, int excepts) /* Get the current exceptions. */ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr)); - *flagp = (fpsr ^ FE_ALL_EXCEPT) & excepts & FE_ALL_EXCEPT; + *flagp = (fexcept_t) ((fpsr >> 13) & excepts & FE_ALL_EXCEPT); /* Success. */ return 0; diff --git a/sysdeps/ia64/fpu/fsetexcptflg.c b/sysdeps/ia64/fpu/fsetexcptflg.c index 5e040416d4..69643636c3 100644 --- a/sysdeps/ia64/fpu/fsetexcptflg.c +++ b/sysdeps/ia64/fpu/fsetexcptflg.c @@ -19,7 +19,6 @@ Boston, MA 02111-1307, USA. */ #include <fenv.h> -#include <math.h> int fesetexceptflag (const fexcept_t *flagp, int excepts) @@ -29,12 +28,10 @@ fesetexceptflag (const fexcept_t *flagp, int excepts) /* Get the current exception state. */ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr)); - /* Get the reverse bits so we can enable the exceptions flagged - rather than disable them. */ - excepts ^= FE_ALL_EXCEPT; + fpsr &= ~(((fenv_t) excepts & FE_ALL_EXCEPT) << 13); /* Set all the bits that were called for. */ - fpsr = (fpsr & ~FE_ALL_EXCEPT) | (*flagp & excepts & FE_ALL_EXCEPT); + fpsr |= ((*flagp & excepts & FE_ALL_EXCEPT) << 13); /* And store it back. */ __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory"); diff --git a/sysdeps/ia64/gccframe.h b/sysdeps/ia64/gccframe.h new file mode 100644 index 0000000000..606bec630f --- /dev/null +++ b/sysdeps/ia64/gccframe.h @@ -0,0 +1,32 @@ +/* Definition of object in frame unwind info. ia64 version. + Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This must match what's in frame.h in gcc. */ + +struct object +{ + void *pc_base; /* This field will be set by find_fde. */ + void *pc_begin; + void *pc_end; + void *fde_begin; + void *fde_end; + void *fde_array; + __SIZE_TYPE__ count; + struct object *next; +}; |