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 };
__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
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.
__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;
@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
# 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)) \
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);
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);
}
# 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
--- /dev/null
+/* 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;
+};
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
/*
/* 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)
__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");
/* 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");
/* 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");
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;
int
fesetround (int round)
{
- unsigned long int fpsr;
+ fenv_t fpsr;
if (round & ~3)
return 0;
__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");
/* 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;
Boston, MA 02111-1307, USA. */
#include <fenv.h>
-#include <math.h>
int
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");
--- /dev/null
+/* 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;
+};