mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-06 14:10:30 +08:00
Updated to fedora-glibc-20050401T1444
This commit is contained in:
parent
e3166b6660
commit
e8eaba2b25
300
ChangeLog
300
ChangeLog
@ -1,8 +1,304 @@
|
||||
2005-03-31 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* sysdeps/ia64/fpu/libm_cpu_defs.h: Update copyright.
|
||||
|
||||
2005-04-01 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* wcsmbs/btowc.c (__btowc): Optimize parameters in ASCII range.
|
||||
* wcsmbs/wctob.c (wctob): Likewise.
|
||||
* wcsmbs/wchar.h (btowc): Add optimized inline function.
|
||||
(wctob): Likewise.
|
||||
|
||||
2005-03-31 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/x86_64/getcontext.S: Use functionally
|
||||
equivalent, but shorter instructions.
|
||||
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/setcontext.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/swapcontext.S: Likewise.
|
||||
* sysdeps/unix/x86_64/sysdep.S: Likewise.
|
||||
* sysdeps/x86_64/strchr.S: Likewise.
|
||||
* sysdeps/x86_64/memset.S: Likewise.
|
||||
* sysdeps/x86_64/strcspn.S: Likewise.
|
||||
* sysdeps/x86_64/strcmp.S: Likewise.
|
||||
* sysdeps/x86_64/elf/start.S: Likewise.
|
||||
* sysdeps/x86_64/strspn.S: Likewise.
|
||||
* sysdeps/x86_64/dl-machine.h: Likewise.
|
||||
* sysdeps/x86_64/bsd-_setjmp.S: Likewise.
|
||||
* sysdeps/x86_64/bsd-setjmp.S: Likewise.
|
||||
* sysdeps/x86_64/strtok.S: Likewise.
|
||||
|
||||
2005-03-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* sysdeps/ia64/fpu/e_acosf.S: Update from Intel libm 2005-03-21.
|
||||
* sysdeps/ia64/fpu/e_acoshf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_acoshl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_acosh.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_acosl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_acos.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_asinf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_asinl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_asin.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_atan2f.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_atan2.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_atanhf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_atanhl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_atanh.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_coshf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_coshl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_cosh.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp10f.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp10l.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp10.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp2f.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp2l.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp2.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_expf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_exp.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_fmodf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_fmodl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_fmod.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_hypotf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_hypotl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_hypot.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_lgammaf_r.c: Likewise.
|
||||
* sysdeps/ia64/fpu/e_lgammal_r.c: Likewise.
|
||||
* sysdeps/ia64/fpu/e_lgamma_r.c: Likewise.
|
||||
* sysdeps/ia64/fpu/e_log2f.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_log2l.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_log2.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_logf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_logl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_log.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_powf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_powl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_pow.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_remainderf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_remainderl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_remainder.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_scalbf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_scalbl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_scalb.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_sinhf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_sinhl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_sinh.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_sqrtf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_sqrtl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/e_sqrt.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_error.c: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_lgammaf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_lgammal.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_lgamma.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_scalblnf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_sincosf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_sincos_large.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_sincosl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_sincos.S: Likewise.
|
||||
* sysdeps/ia64/fpu/libm_support.h: Likewise.
|
||||
* sysdeps/ia64/fpu/s_asinhl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_asinh.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_atanf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_atanl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_cbrtf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_cbrtl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_cosf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_cosl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_cos.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_erfcf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_erfcl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_erfc.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_erfl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_erf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_expm1f.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_expm1l.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_expm1.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_fdimf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_fdiml.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_fdim.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_frexp.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_frexpf.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_frexpl.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_ilogbf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_ilogbl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_ilogb.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_ldexp.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_ldexpf.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_ldexpl.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_libm_ldexpf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_libm_ldexpl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_libm_ldexp.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_libm_scalbnf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_libm_scalbnl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_libm_scalbn.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_log1pf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_log1pl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_log1p.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_logbf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_logbl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_logb.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nearbyintf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nearbyintl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nearbyint.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nextafterf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nextafterl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nextafter.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nexttowardf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nexttowardl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_nexttoward.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_roundf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_roundl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_round.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_scalblnf.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_scalbn.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_scalbnf.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_scalbnl.c: Likewise.
|
||||
* sysdeps/ia64/fpu/s_tanf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_tanhl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_tanh.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_tanl.S: Likewise.
|
||||
* sysdeps/ia64/fpu/s_tan.S: Likewise.
|
||||
* sysdeps/ia64/fpu/w_lgamma.c: Likewise.
|
||||
* sysdeps/ia64/fpu/w_lgammaf.c: Likewise.
|
||||
* sysdeps/ia64/fpu/w_lgammal.c: Likewise.
|
||||
* sysdeps/ia64/fpu/w_tgammaf.S: Likewise.
|
||||
* sysdeps/ia64/fpu/w_tgammal.S: Likewise.
|
||||
* sysdeps/ia64/fpu/w_tgamma.S: Likewise.
|
||||
|
||||
* sysdeps/ia64/fpu/libm_cpu_defs.h: New file.
|
||||
* sysdeps/ia64/fpu/libm_error_codes.h: New file.
|
||||
|
||||
* sysdeps/ia64/fpu/gen_import_file_list: Updated for Intel libm
|
||||
2005-03-21.
|
||||
* sysdeps/ia64/fpu/import_file.awk: Likewise.
|
||||
* sysdeps/ia64/fpu/import_intel_libm: Likewise.
|
||||
* sysdeps/ia64/fpu/Makefile: Likewise.
|
||||
|
||||
2005-03-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* posix/fnmatch.c (fnmatch): For short patterns or strings attempt to
|
||||
avoid calling mbsrtowcs twice.
|
||||
|
||||
2005-03-29 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_discover_osversion): New
|
||||
function, inline broken out of ...
|
||||
(DL_SYSDEP_OSCHECK): ... here. Use that.
|
||||
Do the discovery and set GLRO(dl_osversion) if successful,
|
||||
if __LINUX_KERNEL_VERSION <= 0.
|
||||
* elf/dl-load.c: Don't include dl-osinfo.h here.
|
||||
|
||||
2005-03-29 Alfred M. Szmidt <ams@gnu.org>
|
||||
|
||||
* manual/install.texi (Tools for Compilation): GNU binutils 2.15
|
||||
is now needed.
|
||||
|
||||
2005-03-19 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
* intl/dcigettext.c (struct known_translation_t): Change type of
|
||||
domainname field to 'const char *'.
|
||||
(DCIGETTEXT): Remove const-cast.
|
||||
|
||||
2005-03-29 Thorsten Kukuk <kukuk@suse.de>
|
||||
|
||||
[BZ #661]
|
||||
* grp/initgroups.c (internal_getgrouplist): Check if we have
|
||||
enough space before adding the primary group to the list.
|
||||
|
||||
* posix/tst-execle1.c (do_test): Fix execle arguments.
|
||||
* posix/tst-execle2.c (do_test): Likewise.
|
||||
|
||||
2005-03-28 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* locale/langinfo.h (_NL_LOCALE_NAME): New macro.
|
||||
[__USE_GNU] (NL_LOCALE_NAME): New macro.
|
||||
* locale/nl_langinfo.c: Grok special item value for _NL_LOCALE_NAME,
|
||||
return locale name string for the category.
|
||||
|
||||
2005-03-25 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED.
|
||||
* sysdeps/wordsize-64/wcstol_l.c: Likewise.
|
||||
* sysdeps/generic/wcstoul_l.c: Include "wcstol_l.c" rather than
|
||||
<wcstol_l.c>.
|
||||
|
||||
2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* sysdeps/mips/atomicity.h: Remove unused file.
|
||||
* sysdeps/mips/dl-machine.h (elf_machine_rel): Add TLS relocations.
|
||||
* sysdeps/mips/dl-tls.h: New file.
|
||||
* sysdeps/mips/libc-tls.c: New file.
|
||||
* sysdeps/mips/tls-macros.h: New file.
|
||||
* sysdeps/mips/bits/atomic.h: New file.
|
||||
* sysdeps/mips/bits/setjmp.h: Protect against multiple inclusion.
|
||||
* sysdeps/mips/elf/configure.in: New file.
|
||||
* sysdeps/mips/elf/configure: Generated.
|
||||
* sysdeps/mips/sys/asm.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/vfork.S: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/clone.S: Add NPTL and five-argument
|
||||
clone support.
|
||||
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
|
||||
(INTERNAL_SYSCALL_NCS): New.
|
||||
(INTERNAL_SYSCALL): Update for non-constant support.
|
||||
(internal_syscall0): Likewise.
|
||||
(internal_syscall1): Likewise.
|
||||
(internal_syscall2): Likewise.
|
||||
(internal_syscall3): Likewise.
|
||||
(internal_syscall4): Likewise.
|
||||
(internal_syscall5): Likewise.
|
||||
(internal_syscall6): Likewise.
|
||||
(internal_syscall7): Likewise.
|
||||
* sysdeps/unix/sysv/linux/mips/bits/siginfo.h (SIGEV_THREAD):
|
||||
Update to match the kernel.
|
||||
(SIGEV_CALLBACK): Likewise.
|
||||
(SIGEV_THREAD_ID): Likewise.
|
||||
|
||||
2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
[BZ #783]
|
||||
* elf/tst-auditmod1.c: Add MIPS support.
|
||||
* sysdeps/generic/ldsodefs.h (La_mips_32_regs): New.
|
||||
(La_mips_32_retval): New.
|
||||
(La_mips_64_regs): New.
|
||||
(La_mips_64_retval): New.
|
||||
(struct audit_ifaces): Add MIPS entries.
|
||||
* sysdeps/mips/dl-machine.h: Check RESOLVE_MAP instead of RESOLVE.
|
||||
(elf_machine_runtime_link_map, ELF_DL_FRAME_SIZE,
|
||||
ELF_DL_SAVE_ARG_REGS, ELF_DL_RESTORE_ARG_REGS,
|
||||
ELF_MACHINE_RUNTIME_TRAMPOLINE): Move to dl-trampoline.c.
|
||||
(RTLD_START): Align the stack before calling _dl_init_internal.
|
||||
Use .ent for _dl_start_user.
|
||||
(ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT): Define.
|
||||
(elf_machine_rel, elf_machine_rel_relative, elf_machine_lazy_rel)
|
||||
(elf_machine_runtime_setup): Use "auto inline".
|
||||
(elf_machine_rela, elf_machine_rela_relative): Provide empty versions.
|
||||
(elf_machine_got_rel): Likewise. Use RESOLVE_MAP.
|
||||
* sysdeps/mips/dl-trampoline.c: New file.
|
||||
* sysdeps/mips/bits/link.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
|
||||
(internal_syscall5): Use register operands instead of non-lvalue
|
||||
memory operands.
|
||||
(internal_syscall6): Likewise.
|
||||
(internal_syscall7): Likewise.
|
||||
|
||||
2005-03-27 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* debug/warning-nop.c (__builtin___memcpy_chk): Define away to
|
||||
avoid warnings with older compiler.
|
||||
(__builtin___memcpy_chk): Likewise.
|
||||
(__builtin___memmove_chk: Likewise.
|
||||
(__builtin___mempcpy_chk): Likewise.
|
||||
(__builtin___memset_chk): Likewise.
|
||||
(__builtin___stpcpy_chk): Likewise.
|
||||
(__builtin___strcat_chk): Likewise.
|
||||
(__builtin___strcpy_chk): Likewise.
|
||||
(__builtin___strncat_chk): Likewise.
|
||||
(__builtin___strncpy_chk): Likewise.
|
||||
(__builtin_object_size): Likewise.
|
||||
|
||||
2005-03-27 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* elf/tls-macros.h: Correct typo.
|
||||
|
||||
>>>>>>> 1.9308
|
||||
2005-03-23 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* nis/ypclnt.c (yp_2_yperr): Revert 2004-11-30 patch.
|
||||
|
@ -37,4 +37,17 @@ nop (void)
|
||||
/* Following here we need an #include for each public header file
|
||||
that uses __warndecl. */
|
||||
|
||||
/* Define away to avoid warnings with compilers that do not have these
|
||||
builtins. */
|
||||
#define __builtin___memcpy_chk(dest, src, len, bos) NULL
|
||||
#define __builtin___memmove_chk(dest, src, len, bos) NULL
|
||||
#define __builtin___mempcpy_chk(dest, src, len, bos) NULL
|
||||
#define __builtin___memset_chk(dest, ch, len, bos) NULL
|
||||
#define __builtin___stpcpy_chk(dest, src, bos) NULL
|
||||
#define __builtin___strcat_chk(dest, src, bos) NULL
|
||||
#define __builtin___strcpy_chk(dest, src, bos) NULL
|
||||
#define __builtin___strncat_chk(dest, src, len, bos) NULL
|
||||
#define __builtin___strncpy_chk(dest, src, len, bos) NULL
|
||||
#define __builtin_object_size(bos, level) 0
|
||||
|
||||
#include <string.h>
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <sys/types.h>
|
||||
#include "dynamic-link.h"
|
||||
#include <abi-tag.h>
|
||||
#include <dl-osinfo.h>
|
||||
#include <stackinfo.h>
|
||||
#include <caller.h>
|
||||
#include <sysdep.h>
|
||||
|
@ -733,6 +733,6 @@ register void *__gp __asm__("$29");
|
||||
})
|
||||
|
||||
#elif !defined TLS_LE || !defined TLS_IE \
|
||||
|| !defined TLS_LD || !defined TLS_GD(x)
|
||||
|| !defined TLS_LD || !defined TLS_GD
|
||||
# error "No support for this architecture so far."
|
||||
#endif
|
||||
|
@ -162,6 +162,24 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
# define La_regs La_ia64_regs
|
||||
# define La_retval La_ia64_retval
|
||||
# define int_retval lrv_r8
|
||||
#elif defined __mips__ && _MIPS_SIM == _ABIO32
|
||||
# define pltenter la_mips_o32_gnu_pltenter
|
||||
# define pltexit la_mips_o32_gnu_pltexit
|
||||
# define La_regs La_mips_32_regs
|
||||
# define La_retval La_mips_32_retval
|
||||
# define int_retval lrv_v0
|
||||
#elif defined __mips__ && _MIPS_SIM == _ABIN32
|
||||
# define pltenter la_mips_n32_gnu_pltenter
|
||||
# define pltexit la_mips_n32_gnu_pltexit
|
||||
# define La_regs La_mips_64_regs
|
||||
# define La_retval La_mips_64_retval
|
||||
# define int_retval lrv_v0
|
||||
#elif defined __mips__ && _MIPS_SIM == _ABI64
|
||||
# define pltenter la_mips_n64_gnu_pltenter
|
||||
# define pltexit la_mips_n64_gnu_pltexit
|
||||
# define La_regs La_mips_64_regs
|
||||
# define La_retval La_mips_64_retval
|
||||
# define int_retval lrv_v0
|
||||
#else
|
||||
# error "architecture specific code needed"
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
# This file is updated automatically by Makefile.
|
||||
glibc-branch := fedora
|
||||
glibc-base := HEAD
|
||||
fedora-sync-date := 2005-03-24 07:15 UTC
|
||||
fedora-sync-tag := fedora-glibc-20050324T0715
|
||||
fedora-sync-date := 2005-04-01 14:44 UTC
|
||||
fedora-sync-tag := fedora-glibc-20050401T1444
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1989,91,93,1996-2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989,91,93,1996-2003, 2004, 2005 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
|
||||
@ -73,7 +73,9 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
|
||||
/* Start is one, because we have the first group as parameter. */
|
||||
long int start = 1;
|
||||
|
||||
(*groupsp)[0] = group;
|
||||
/* Never store more than the starting *SIZE number of elements. */
|
||||
if (*size > 0)
|
||||
(*groupsp)[0] = group;
|
||||
|
||||
if (__nss_group_database != NULL)
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ static void *mempcpy PARAMS ((void *dest, const void *src, size_t n));
|
||||
struct known_translation_t
|
||||
{
|
||||
/* Domain in which to search. */
|
||||
char *domainname;
|
||||
const char *domainname;
|
||||
|
||||
/* The category. */
|
||||
int category;
|
||||
@ -436,7 +436,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
|
||||
search = (struct known_translation_t *)
|
||||
alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
|
||||
memcpy (search->msgid, msgid1, msgid_len);
|
||||
search->domainname = (char *) domainname;
|
||||
search->domainname = domainname;
|
||||
search->category = category;
|
||||
|
||||
/* Since tfind/tsearch manage a balanced tree, concurrent tfind and
|
||||
@ -632,9 +632,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
|
||||
+ msgid_len + domainname_len + 1);
|
||||
if (newp != NULL)
|
||||
{
|
||||
newp->domainname =
|
||||
mempcpy (newp->msgid, msgid1, msgid_len);
|
||||
memcpy (newp->domainname, domainname, domainname_len + 1);
|
||||
char *new_domainname;
|
||||
|
||||
new_domainname = mempcpy (newp->msgid, msgid1, msgid_len);
|
||||
memcpy (new_domainname, domainname, domainname_len + 1);
|
||||
newp->domainname = new_domainname;
|
||||
newp->category = category;
|
||||
newp->counter = _nl_msg_cat_cntr;
|
||||
newp->domain = domain;
|
||||
|
@ -1,3 +1,13 @@
|
||||
2005-03-31 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Use
|
||||
functionally equivalent, but shorter instructions.
|
||||
|
||||
2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* sysdeps/mips/tls.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/vfork.S: New file.
|
||||
|
||||
2005-03-21 GOTO Masanori <gotom@debian.or.jp>
|
||||
|
||||
* linuxthreads/sysdeps/m68k/Makefile: Remove to delete
|
||||
|
170
linuxthreads/sysdeps/mips/tls.h
Normal file
170
linuxthreads/sysdeps/mips/tls.h
Normal file
@ -0,0 +1,170 @@
|
||||
/* Definitions for thread-local data handling. linuxthreads/MIPS version.
|
||||
Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _TLS_H
|
||||
#define _TLS_H
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
# include <stdbool.h>
|
||||
# include <pt-machine.h>
|
||||
# include <stddef.h>
|
||||
|
||||
/* Type for the dtv. */
|
||||
typedef union dtv
|
||||
{
|
||||
size_t counter;
|
||||
struct
|
||||
{
|
||||
void *val;
|
||||
bool is_static;
|
||||
} pointer;
|
||||
} dtv_t;
|
||||
|
||||
# define READ_THREAD_POINTER() \
|
||||
({ void *__result; \
|
||||
asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \
|
||||
"rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \
|
||||
__result; })
|
||||
|
||||
#else /* __ASSEMBLER__ */
|
||||
# include <tcb-offsets.h>
|
||||
|
||||
/* Note: rd must be $v1 to be ABI-conformant. */
|
||||
# define READ_THREAD_POINTER(rd) \
|
||||
.set push; \
|
||||
.set mips32r2; \
|
||||
rdhwr rd, $29; \
|
||||
.set pop
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
/* LinuxThreads can only use TLS if both floating stacks (in the MIPS case,
|
||||
that means support for "rdhwr") and support from the tools are available.
|
||||
|
||||
We have to define USE_TLS consistently, or ldsodefs.h will lay out types
|
||||
differently between an NPTL build and a LinuxThreads build. It can be set
|
||||
for libc.so and not libpthread.so, but only if we provide appropriate padding
|
||||
in the _pthread_descr_struct.
|
||||
|
||||
Currently nothing defines FLOATING_STACKS. We could assume this based on
|
||||
kernel version once the TLS patches are available in kernel.org, but
|
||||
it hardly seems worth it. Use NPTL if you can.
|
||||
|
||||
To avoid bothering with the TLS support code at all, use configure
|
||||
--without-tls. */
|
||||
|
||||
#if defined HAVE_TLS_SUPPORT \
|
||||
&& (defined FLOATING_STACKS || !defined IS_IN_libpthread)
|
||||
|
||||
/* Signal that TLS support is available. */
|
||||
# define USE_TLS 1
|
||||
|
||||
/* Include padding in _pthread_descr_struct so that libc can find p_errno,
|
||||
if libpthread will only include the padding because of the !IS_IN_libpthread
|
||||
check. */
|
||||
#ifndef FLOATING_STACKS
|
||||
# define INCLUDE_TLS_PADDING 1
|
||||
#endif
|
||||
|
||||
# ifndef __ASSEMBLER__
|
||||
|
||||
/* This layout is actually wholly private and not affected by the ABI.
|
||||
Nor does it overlap the pthread data structure, so we need nothing
|
||||
extra here at all. */
|
||||
typedef struct
|
||||
{
|
||||
dtv_t *dtv;
|
||||
void *private;
|
||||
} tcbhead_t;
|
||||
|
||||
/* This is the size of the initial TCB. */
|
||||
# define TLS_INIT_TCB_SIZE 0
|
||||
|
||||
/* Alignment requirements for the initial TCB. */
|
||||
# define TLS_INIT_TCB_ALIGN __alignof__ (struct _pthread_descr_struct)
|
||||
|
||||
/* This is the size of the TCB. */
|
||||
# define TLS_TCB_SIZE 0
|
||||
|
||||
/* Alignment requirements for the TCB. */
|
||||
# define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct)
|
||||
|
||||
/* This is the size we need before TCB. */
|
||||
# define TLS_PRE_TCB_SIZE \
|
||||
(sizeof (struct _pthread_descr_struct) \
|
||||
+ ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
|
||||
|
||||
/* The thread pointer (in hardware register $29) points to the end of
|
||||
the TCB + 0x7000, as for PowerPC. The pthread_descr structure is
|
||||
immediately in front of the TCB. */
|
||||
#define TLS_TCB_OFFSET 0x7000
|
||||
|
||||
/* The DTV is allocated at the TP; the TCB is placed elsewhere. */
|
||||
/* This is not really true for powerpc64. We are following alpha
|
||||
where the DTV pointer is first doubleword in the TCB. */
|
||||
# define TLS_DTV_AT_TP 1
|
||||
|
||||
/* Install the dtv pointer. The pointer passed is to the element with
|
||||
index -1 which contain the length. */
|
||||
# define INSTALL_DTV(TCBP, DTVP) \
|
||||
(((tcbhead_t *) (TCBP))[-1].dtv = (DTVP) + 1)
|
||||
|
||||
/* Install new dtv for current thread. */
|
||||
# define INSTALL_NEW_DTV(DTV) (THREAD_DTV() = (DTV))
|
||||
|
||||
/* Return dtv of given thread descriptor. */
|
||||
# define GET_DTV(TCBP) (((tcbhead_t *) (TCBP))[-1].dtv)
|
||||
|
||||
/* Code to initially initialize the thread pointer. This might need
|
||||
special attention since 'errno' is not yet available and if the
|
||||
operation can cause a failure 'errno' must not be touched. */
|
||||
# define TLS_INIT_TP(tcbp, secondcall) \
|
||||
({ INTERNAL_SYSCALL_DECL (err); \
|
||||
long result_var; \
|
||||
result_var = INTERNAL_SYSCALL (set_thread_area, err, 1, \
|
||||
(char *) (tcbp) + TLS_TCB_OFFSET); \
|
||||
INTERNAL_SYSCALL_ERROR_P (result_var, err) \
|
||||
? "unknown error" : NULL; })
|
||||
|
||||
/* Return the address of the dtv for the current thread. */
|
||||
# define THREAD_DTV() \
|
||||
(((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))[-1].dtv)
|
||||
|
||||
/* Return the thread descriptor for the current thread. */
|
||||
# undef THREAD_SELF
|
||||
# define THREAD_SELF \
|
||||
((pthread_descr) (READ_THREAD_POINTER () \
|
||||
- TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
|
||||
|
||||
/* Get the thread descriptor definition. */
|
||||
# include <linuxthreads/descr.h>
|
||||
|
||||
/* l_tls_offset == 0 is perfectly valid on MIPS, so we have to use some
|
||||
different value to mean unset l_tls_offset. */
|
||||
# define NO_TLS_OFFSET -1
|
||||
|
||||
/* Initializing the thread pointer requires a syscall which may not be
|
||||
available, so don't do it if we don't need to. */
|
||||
# define TLS_INIT_TP_EXPENSIVE 1
|
||||
|
||||
# endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* HAVE_TLS_SUPPORT */
|
||||
|
||||
#endif /* tls.h */
|
104
linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S
Normal file
104
linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S
Normal file
@ -0,0 +1,104 @@
|
||||
/* Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* vfork() is just a special case of clone(). */
|
||||
|
||||
#include <sys/asm.h>
|
||||
#include <sysdep.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
/* int vfork() */
|
||||
|
||||
.text
|
||||
LOCALSZ= 1
|
||||
FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
|
||||
GPOFF= FRAMESZ-(1*SZREG)
|
||||
NESTED(__vfork,FRAMESZ,sp)
|
||||
#ifdef __PIC__
|
||||
SETUP_GP
|
||||
#endif
|
||||
PTR_SUBU sp, FRAMESZ
|
||||
SETUP_GP64 (a5, __vfork)
|
||||
#ifdef __PIC__
|
||||
SAVE_GP (GPOFF)
|
||||
#endif
|
||||
#ifdef PROF
|
||||
# if (_MIPS_SIM != _ABIO32)
|
||||
PTR_S a5, GPOFF(sp)
|
||||
# endif
|
||||
.set noat
|
||||
move $1, ra
|
||||
# if (_MIPS_SIM == _ABIO32)
|
||||
subu sp,sp,8
|
||||
# endif
|
||||
jal _mcount
|
||||
.set at
|
||||
# if (_MIPS_SIM != _ABIO32)
|
||||
PTR_L a5, GPOFF(sp)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* If libpthread is loaded, we need to call fork instead. */
|
||||
#ifdef SHARED
|
||||
PTR_L a0, __libc_pthread_functions
|
||||
#else
|
||||
.weak pthread_create
|
||||
PTR_LA a0, pthread_create
|
||||
#endif
|
||||
|
||||
PTR_ADDU sp, FRAMESZ
|
||||
|
||||
bnez a0, L(call_fork)
|
||||
|
||||
li a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */
|
||||
move a1, sp
|
||||
|
||||
/* Do the system call */
|
||||
li v0,__NR_clone
|
||||
syscall
|
||||
|
||||
bnez a3,L(error)
|
||||
|
||||
/* Successful return from the parent or child. */
|
||||
RESTORE_GP64
|
||||
ret
|
||||
|
||||
/* Something bad happened -- no child created. */
|
||||
L(error):
|
||||
#ifdef __PIC__
|
||||
PTR_LA t9, __syscall_error
|
||||
RESTORE_GP64
|
||||
jr t9
|
||||
#else
|
||||
RESTORE_GP64
|
||||
j __syscall_error
|
||||
#endif
|
||||
|
||||
L(call_fork):
|
||||
#ifdef __PIC__
|
||||
PTR_LA t9, fork
|
||||
RESTORE_GP64
|
||||
jr t9
|
||||
#else
|
||||
RESTORE_GP64
|
||||
j fork
|
||||
#endif
|
||||
END(__vfork)
|
||||
|
||||
libc_hidden_def(__vfork)
|
||||
weak_alias(__vfork, vfork)
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
POPARGS_##args \
|
||||
/* The return value from CENABLE is argument for CDISABLE. */ \
|
||||
movq %rax, (%rsp); \
|
||||
movq $SYS_ify (syscall_name), %rax; \
|
||||
movl $SYS_ify (syscall_name), %eax; \
|
||||
syscall; \
|
||||
movq (%rsp), %rdi; \
|
||||
/* Save %rax since it's the error code from the syscall. */ \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Access to locale-dependent parameters.
|
||||
Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2002,2003,2004,2005 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
|
||||
@ -38,7 +38,6 @@ __BEGIN_DECLS
|
||||
#define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16)
|
||||
#define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff)
|
||||
|
||||
|
||||
/* Enumeration of locale items that can be queried with `nl_langinfo'. */
|
||||
enum
|
||||
{
|
||||
@ -566,6 +565,13 @@ enum
|
||||
_NL_NUM
|
||||
};
|
||||
|
||||
/* This macro produces an item you can pass to `nl_langinfo' or
|
||||
`nl_langinfo_l' to get the name of the locale in use for CATEGORY. */
|
||||
#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1)
|
||||
#ifdef __USE_GNU
|
||||
# define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category)
|
||||
#endif
|
||||
|
||||
|
||||
/* Return the current locale's value for ITEM.
|
||||
If ITEM is invalid, an empty string is returned.
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* User interface for extracting locale-dependent parameters.
|
||||
Copyright (C) 1995,96,97,99,2000,01,02 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995,96,97,99,2000,2001,2002,2005
|
||||
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
|
||||
@ -45,6 +46,18 @@ nl_langinfo (item)
|
||||
/* Bogus category: bogus item. */
|
||||
return (char *) "";
|
||||
|
||||
/* Special case value for NL_LOCALE_NAME (category).
|
||||
This is not a real item index in the string table. */
|
||||
if (index == _NL_ITEM_INDEX (_NL_LOCALE_NAME (category)))
|
||||
{
|
||||
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
||||
# define THISLOCALE l
|
||||
#else
|
||||
# define THISLOCALE _NL_CURRENT_LOCALE
|
||||
#endif
|
||||
return (char *) THISLOCALE->__names[category];
|
||||
}
|
||||
|
||||
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
||||
data = l->__locales[category];
|
||||
#elif defined NL_CURRENT_INDIRECT
|
||||
|
@ -350,7 +350,7 @@ floating-point support that may be triggered by the math library.
|
||||
Check the FAQ for any special compiler issues on particular platforms.
|
||||
|
||||
@item
|
||||
GNU @code{binutils} 2.13 or later
|
||||
GNU @code{binutils} 2.15 or later
|
||||
|
||||
You must use GNU @code{binutils} (as and ld) to build the GNU C library.
|
||||
No other assembler or linker has the necessary functionality at the
|
||||
|
@ -1,3 +1,46 @@
|
||||
2005-03-31 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
|
||||
functionally equivalent, but shorter instructions.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
|
||||
Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
|
||||
Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
|
||||
|
||||
2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* sysdeps/mips/Makefile: New file.
|
||||
* sysdeps/mips/nptl-sysdep.S: New file.
|
||||
* sysdeps/mips/tcb-offsets.sym: New file.
|
||||
* sysdeps/mips/pthread_spin_lock.S: New file.
|
||||
* sysdeps/mips/pthread_spin_trylock.S: New file.
|
||||
* sysdeps/mips/pthreaddef.h: New file.
|
||||
* sysdeps/mips/tls.h: New file.
|
||||
* sysdeps/mips/jmpbuf-unwind.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/fork.c: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/vfork.S: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/clone.S: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/createthread.c: New file.
|
||||
* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
|
||||
|
||||
2005-03-23 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* pthread_create.c (__pthread_create_2_1): Rename syscall error
|
||||
|
25
nptl/sysdeps/mips/Makefile
Normal file
25
nptl/sysdeps/mips/Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright (C) 2005 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 Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with the GNU C Library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA.
|
||||
|
||||
ifeq ($(subdir),csu)
|
||||
gen-as-const-headers += tcb-offsets.sym
|
||||
endif
|
||||
|
||||
ifeq ($(subdir),nptl)
|
||||
libpthread-sysdep_routines += nptl-sysdep
|
||||
endif
|
30
nptl/sysdeps/mips/jmpbuf-unwind.h
Normal file
30
nptl/sysdeps/mips/jmpbuf-unwind.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* Copyright (C) 2003, 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <stdint.h>
|
||||
#include <unwind.h>
|
||||
|
||||
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
|
||||
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
|
||||
|
||||
#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
|
||||
((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[0].__sp - (_adj))
|
||||
|
||||
/* We use the normal longjmp for unwinding. */
|
||||
#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
|
2
nptl/sysdeps/mips/nptl-sysdep.S
Normal file
2
nptl/sysdeps/mips/nptl-sysdep.S
Normal file
@ -0,0 +1,2 @@
|
||||
/* Pull in __syscall_error. */
|
||||
#include <sysdep.S>
|
37
nptl/sysdeps/mips/pthread_spin_lock.S
Normal file
37
nptl/sysdeps/mips/pthread_spin_lock.S
Normal file
@ -0,0 +1,37 @@
|
||||
/* Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sys/asm.h>
|
||||
#include <sysdep.h>
|
||||
#include <sgidefs.h>
|
||||
|
||||
ENTRY (pthread_spin_lock)
|
||||
.set push
|
||||
#if _MIPS_SIM == _ABIO32
|
||||
.set mips2
|
||||
#endif
|
||||
1: ll a2, 0(a0)
|
||||
li a1, 1
|
||||
bnez a2, 1b
|
||||
sc a1, 0(a0)
|
||||
beqz a1, 1b
|
||||
MIPS_SYNC
|
||||
.set pop
|
||||
li v0, 0
|
||||
ret
|
||||
PSEUDO_END (pthread_spin_lock)
|
41
nptl/sysdeps/mips/pthread_spin_trylock.S
Normal file
41
nptl/sysdeps/mips/pthread_spin_trylock.S
Normal file
@ -0,0 +1,41 @@
|
||||
/* Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sys/asm.h>
|
||||
#include <sysdep.h>
|
||||
#define _ERRNO_H 1
|
||||
#include <bits/errno.h>
|
||||
#include <sgidefs.h>
|
||||
|
||||
ENTRY (pthread_spin_trylock)
|
||||
.set push
|
||||
#if _MIPS_SIM == _ABIO32
|
||||
.set mips2
|
||||
#endif
|
||||
ll a2, 0(a0)
|
||||
li a1, 1
|
||||
bnez a2, 1f
|
||||
sc a1, 0(a0)
|
||||
beqz a1, 1f
|
||||
MIPS_SYNC
|
||||
.set pop
|
||||
li v0, 0
|
||||
ret
|
||||
1: li v0, EBUSY
|
||||
ret
|
||||
PSEUDO_END (pthread_spin_trylock)
|
39
nptl/sysdeps/mips/pthreaddef.h
Normal file
39
nptl/sysdeps/mips/pthreaddef.h
Normal file
@ -0,0 +1,39 @@
|
||||
/* Copyright (C) 2002, 2003, 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Default stack size. */
|
||||
#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
|
||||
|
||||
/* Required stack pointer alignment at beginning. */
|
||||
#define STACK_ALIGN 16
|
||||
|
||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||
#define MINIMAL_REST_STACK 2048
|
||||
|
||||
/* Alignment requirement for TCB. */
|
||||
#define TCB_ALIGNMENT 16
|
||||
|
||||
|
||||
/* Location of current stack frame. */
|
||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||
|
||||
|
||||
/* XXX Until we have a better place keep the definitions here. */
|
||||
|
||||
#define __exit_thread_inline(val) \
|
||||
INLINE_SYSCALL (exit, 1, (val))
|
11
nptl/sysdeps/mips/tcb-offsets.sym
Normal file
11
nptl/sysdeps/mips/tcb-offsets.sym
Normal file
@ -0,0 +1,11 @@
|
||||
#include <sysdep.h>
|
||||
#include <tls.h>
|
||||
|
||||
--
|
||||
|
||||
-- Abuse tls.h macros to derive offsets relative to the thread register.
|
||||
#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
|
||||
|
||||
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
|
||||
PID_OFFSET thread_offsetof (pid)
|
||||
TID_OFFSET thread_offsetof (tid)
|
161
nptl/sysdeps/mips/tls.h
Normal file
161
nptl/sysdeps/mips/tls.h
Normal file
@ -0,0 +1,161 @@
|
||||
/* Definition for thread-local data handling. NPTL/MIPS version.
|
||||
Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _TLS_H
|
||||
#define _TLS_H 1
|
||||
|
||||
#include <dl-sysdep.h>
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
# include <stdbool.h>
|
||||
# include <stddef.h>
|
||||
# include <stdint.h>
|
||||
|
||||
/* Type for the dtv. */
|
||||
typedef union dtv
|
||||
{
|
||||
size_t counter;
|
||||
struct
|
||||
{
|
||||
void *val;
|
||||
bool is_static;
|
||||
} pointer;
|
||||
} dtv_t;
|
||||
|
||||
/* Note: rd must be $v1 to be ABI-conformant. */
|
||||
# define READ_THREAD_POINTER() \
|
||||
({ void *__result; \
|
||||
asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \
|
||||
"rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \
|
||||
__result; })
|
||||
|
||||
#else /* __ASSEMBLER__ */
|
||||
# include <tcb-offsets.h>
|
||||
|
||||
# define READ_THREAD_POINTER(rd) \
|
||||
.set push; \
|
||||
.set mips32r2; \
|
||||
rdhwr rd, $29; \
|
||||
.set pop
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
|
||||
/* We require TLS support in the tools. */
|
||||
#ifndef HAVE_TLS_SUPPORT
|
||||
# error "TLS support is required."
|
||||
#endif
|
||||
|
||||
/* Signal that TLS support is available. */
|
||||
#define USE_TLS 1
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* Get system call information. */
|
||||
# include <sysdep.h>
|
||||
|
||||
/* The TP points to the start of the thread blocks. */
|
||||
# define TLS_DTV_AT_TP 1
|
||||
|
||||
/* Get the thread descriptor definition. */
|
||||
# include <nptl/descr.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
dtv_t *dtv;
|
||||
void *private;
|
||||
} tcbhead_t;
|
||||
|
||||
/* This is the size of the initial TCB. Because our TCB is before the thread
|
||||
pointer, we don't need this. */
|
||||
# define TLS_INIT_TCB_SIZE 0
|
||||
|
||||
/* Alignment requirements for the initial TCB. */
|
||||
# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
|
||||
|
||||
/* This is the size of the TCB. Because our TCB is before the thread
|
||||
pointer, we don't need this. */
|
||||
# define TLS_TCB_SIZE 0
|
||||
|
||||
/* Alignment requirements for the TCB. */
|
||||
# define TLS_TCB_ALIGN __alignof__ (struct pthread)
|
||||
|
||||
/* This is the size we need before TCB - actually, it includes the TCB. */
|
||||
# define TLS_PRE_TCB_SIZE \
|
||||
(sizeof (struct pthread) \
|
||||
+ ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
|
||||
|
||||
/* The thread pointer (in hardware register $29) points to the end of
|
||||
the TCB + 0x7000, as for PowerPC. The pthread_descr structure is
|
||||
immediately in front of the TCB. */
|
||||
# define TLS_TCB_OFFSET 0x7000
|
||||
|
||||
/* Install the dtv pointer. The pointer passed is to the element with
|
||||
index -1 which contain the length. */
|
||||
# define INSTALL_DTV(tcbp, dtvp) \
|
||||
(((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
|
||||
|
||||
/* Install new dtv for current thread. */
|
||||
# define INSTALL_NEW_DTV(dtv) \
|
||||
(THREAD_DTV() = (dtv))
|
||||
|
||||
/* Return dtv of given thread descriptor. */
|
||||
# define GET_DTV(tcbp) \
|
||||
(((tcbhead_t *) (tcbp))[-1].dtv)
|
||||
|
||||
/* Code to initially initialize the thread pointer. This might need
|
||||
special attention since 'errno' is not yet available and if the
|
||||
operation can cause a failure 'errno' must not be touched. */
|
||||
# define TLS_INIT_TP(tcbp, secondcall) \
|
||||
({ INTERNAL_SYSCALL_DECL (err); \
|
||||
long result_var; \
|
||||
result_var = INTERNAL_SYSCALL (set_thread_area, err, 1, \
|
||||
(char *) (tcbp) + TLS_TCB_OFFSET); \
|
||||
INTERNAL_SYSCALL_ERROR_P (result_var, err) \
|
||||
? "unknown error" : NULL; })
|
||||
|
||||
/* Return the address of the dtv for the current thread. */
|
||||
# define THREAD_DTV() \
|
||||
(((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))[-1].dtv)
|
||||
|
||||
/* Return the thread descriptor for the current thread. */
|
||||
# define THREAD_SELF \
|
||||
((struct pthread *) (READ_THREAD_POINTER () \
|
||||
- TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
|
||||
|
||||
/* Magic for libthread_db to know how to do THREAD_SELF. */
|
||||
# define DB_THREAD_SELF \
|
||||
CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
|
||||
|
||||
/* Access to data in the thread descriptor is easy. */
|
||||
# define THREAD_GETMEM(descr, member) \
|
||||
descr->member
|
||||
# define THREAD_GETMEM_NC(descr, member, idx) \
|
||||
descr->member[idx]
|
||||
# define THREAD_SETMEM(descr, member, value) \
|
||||
descr->member = (value)
|
||||
# define THREAD_SETMEM_NC(descr, member, idx, value) \
|
||||
descr->member[idx] = (value)
|
||||
|
||||
/* l_tls_offset == 0 is perfectly valid on MIPS, so we have to use some
|
||||
different value to mean unset l_tls_offset. */
|
||||
# define NO_TLS_OFFSET -1
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* tls.h */
|
193
nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
Normal file
193
nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
Normal file
@ -0,0 +1,193 @@
|
||||
/* Machine-specific pthread type layouts. MIPS version.
|
||||
Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _BITS_PTHREADTYPES_H
|
||||
#define _BITS_PTHREADTYPES_H 1
|
||||
|
||||
#if _MIPS_SIM == _ABI64
|
||||
# define __SIZEOF_PTHREAD_ATTR_T 56
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 40
|
||||
# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
|
||||
# define __SIZEOF_PTHREAD_COND_T 48
|
||||
# define __SIZEOF_PTHREAD_CONDATTR_T 4
|
||||
# define __SIZEOF_PTHREAD_RWLOCK_T 56
|
||||
# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
|
||||
# define __SIZEOF_PTHREAD_BARRIER_T 32
|
||||
# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
|
||||
#else
|
||||
# define __SIZEOF_PTHREAD_ATTR_T 36
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 24
|
||||
# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
|
||||
# define __SIZEOF_PTHREAD_COND_T 48
|
||||
# define __SIZEOF_PTHREAD_CONDATTR_T 4
|
||||
# define __SIZEOF_PTHREAD_RWLOCK_T 32
|
||||
# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
|
||||
# define __SIZEOF_PTHREAD_BARRIER_T 20
|
||||
# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
|
||||
#endif
|
||||
|
||||
|
||||
/* Thread identifiers. The structure of the attribute type is
|
||||
deliberately not exposed. */
|
||||
typedef unsigned long int pthread_t;
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_ATTR_T];
|
||||
long int __align;
|
||||
} pthread_attr_t;
|
||||
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is deliberately not exposed. */
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __count;
|
||||
int __owner;
|
||||
#if _MIPS_SIM == _ABI64
|
||||
unsigned int __nusers;
|
||||
#endif
|
||||
/* KIND must stay at this position in the structure to maintain
|
||||
binary compatibility. */
|
||||
int __kind;
|
||||
#if _MIPS_SIM != _ABI64
|
||||
unsigned int __nusers;
|
||||
#endif
|
||||
int __spins;
|
||||
} __data;
|
||||
char __size[__SIZEOF_PTHREAD_MUTEX_T];
|
||||
long int __align;
|
||||
} pthread_mutex_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
|
||||
int __align;
|
||||
} pthread_mutexattr_t;
|
||||
|
||||
|
||||
/* Data structure for conditional variable handling. The structure of
|
||||
the attribute type is deliberately not exposed. */
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __futex;
|
||||
__extension__ unsigned long long int __total_seq;
|
||||
__extension__ unsigned long long int __wakeup_seq;
|
||||
__extension__ unsigned long long int __woken_seq;
|
||||
void *__mutex;
|
||||
unsigned int __nwaiters;
|
||||
unsigned int __broadcast_seq;
|
||||
} __data;
|
||||
char __size[__SIZEOF_PTHREAD_COND_T];
|
||||
__extension__ long long int __align;
|
||||
} pthread_cond_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_CONDATTR_T];
|
||||
int __align;
|
||||
} pthread_condattr_t;
|
||||
|
||||
|
||||
/* Keys for thread-specific data */
|
||||
typedef unsigned int pthread_key_t;
|
||||
|
||||
|
||||
/* Once-only execution */
|
||||
typedef int pthread_once_t;
|
||||
|
||||
|
||||
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
|
||||
/* Data structure for read-write lock variable handling. The
|
||||
structure of the attribute type is deliberately not exposed. */
|
||||
typedef union
|
||||
{
|
||||
# if _MIPS_SIM == _ABI64
|
||||
struct
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __nr_readers;
|
||||
unsigned int __readers_wakeup;
|
||||
unsigned int __writer_wakeup;
|
||||
unsigned int __nr_readers_queued;
|
||||
unsigned int __nr_writers_queued;
|
||||
int __writer;
|
||||
int __pad1;
|
||||
unsigned long int __pad2;
|
||||
unsigned long int __pad3;
|
||||
/* FLAGS must stay at this position in the structure to maintain
|
||||
binary compatibility. */
|
||||
unsigned int __flags;
|
||||
} __data;
|
||||
# else
|
||||
struct
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __nr_readers;
|
||||
unsigned int __readers_wakeup;
|
||||
unsigned int __writer_wakeup;
|
||||
unsigned int __nr_readers_queued;
|
||||
unsigned int __nr_writers_queued;
|
||||
/* FLAGS must stay at this position in the structure to maintain
|
||||
binary compatibility. */
|
||||
unsigned int __flags;
|
||||
int __writer;
|
||||
} __data;
|
||||
# endif
|
||||
char __size[__SIZEOF_PTHREAD_RWLOCK_T];
|
||||
long int __align;
|
||||
} pthread_rwlock_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
|
||||
long int __align;
|
||||
} pthread_rwlockattr_t;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* POSIX spinlock data type. */
|
||||
typedef volatile int pthread_spinlock_t;
|
||||
|
||||
|
||||
/* POSIX barriers data type. The structure of the type is
|
||||
deliberately not exposed. */
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_BARRIER_T];
|
||||
long int __align;
|
||||
} pthread_barrier_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
|
||||
int __align;
|
||||
} pthread_barrierattr_t;
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* bits/pthreadtypes.h */
|
40
nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h
Normal file
40
nptl/sysdeps/unix/sysv/linux/mips/bits/semaphore.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* Copyright (C) 2002, 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SEMAPHORE_H
|
||||
# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
|
||||
#endif
|
||||
|
||||
#if _MIPS_SIM == _ABI64
|
||||
# define __SIZEOF_SEM_T 32
|
||||
#else
|
||||
# define __SIZEOF_SEM_T 16
|
||||
#endif
|
||||
|
||||
/* Value returned if `sem_open' failed. */
|
||||
#define SEM_FAILED ((sem_t *) 0)
|
||||
|
||||
/* Maximum value the semaphore can have. */
|
||||
#define SEM_VALUE_MAX (2147483647)
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_SEM_T];
|
||||
long int __align;
|
||||
} sem_t;
|
2
nptl/sysdeps/unix/sysv/linux/mips/clone.S
Normal file
2
nptl/sysdeps/unix/sysv/linux/mips/clone.S
Normal file
@ -0,0 +1,2 @@
|
||||
#define RESET_PID
|
||||
#include <sysdeps/unix/sysv/linux/mips/clone.S>
|
24
nptl/sysdeps/unix/sysv/linux/mips/createthread.c
Normal file
24
nptl/sysdeps/unix/sysv/linux/mips/createthread.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Value passed to 'clone' for initialization of the thread register. */
|
||||
#define TLS_VALUE ((void *) (pd) \
|
||||
+ TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
|
||||
|
||||
/* Get the real implementation. */
|
||||
#include <nptl/sysdeps/pthread/createthread.c>
|
1
nptl/sysdeps/unix/sysv/linux/mips/fork.c
Normal file
1
nptl/sysdeps/unix/sysv/linux/mips/fork.c
Normal file
@ -0,0 +1 @@
|
||||
#include "../i386/fork.c"
|
216
nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h
Normal file
216
nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h
Normal file
@ -0,0 +1,216 @@
|
||||
/* Copyright (C) 2003, 2004, 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _LOWLEVELLOCK_H
|
||||
#define _LOWLEVELLOCK_H 1
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/param.h>
|
||||
#include <bits/pthreadtypes.h>
|
||||
#include <atomic.h>
|
||||
#include <sysdep.h>
|
||||
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
#define FUTEX_REQUEUE 3
|
||||
#define FUTEX_CMP_REQUEUE 4
|
||||
|
||||
/* Initializer for compatibility lock. */
|
||||
#define LLL_MUTEX_LOCK_INITIALIZER (0)
|
||||
|
||||
#define lll_futex_wait(futexp, val) \
|
||||
({ \
|
||||
INTERNAL_SYSCALL_DECL (__err); \
|
||||
long int __ret; \
|
||||
__ret = INTERNAL_SYSCALL (futex, __err, 4, \
|
||||
(futexp), FUTEX_WAIT, (val), 0); \
|
||||
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
|
||||
})
|
||||
|
||||
#define lll_futex_timed_wait(futexp, val, timespec) \
|
||||
({ \
|
||||
INTERNAL_SYSCALL_DECL (__err); \
|
||||
long int __ret; \
|
||||
__ret = INTERNAL_SYSCALL (futex, __err, 4, \
|
||||
(futexp), FUTEX_WAIT, (val), (timespec)); \
|
||||
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
|
||||
})
|
||||
|
||||
#define lll_futex_wake(futexp, nr) \
|
||||
({ \
|
||||
INTERNAL_SYSCALL_DECL (__err); \
|
||||
long int __ret; \
|
||||
__ret = INTERNAL_SYSCALL (futex, __err, 4, \
|
||||
(futexp), FUTEX_WAKE, (nr), 0); \
|
||||
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
|
||||
})
|
||||
|
||||
/* Returns non-zero if error happened, zero if success. */
|
||||
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \
|
||||
({ \
|
||||
INTERNAL_SYSCALL_DECL (__err); \
|
||||
long int __ret; \
|
||||
__ret = INTERNAL_SYSCALL (futex, __err, 6, \
|
||||
(futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
|
||||
(nr_move), (mutex), (val)); \
|
||||
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
|
||||
})
|
||||
|
||||
|
||||
static inline int __attribute__((always_inline))
|
||||
__lll_mutex_trylock(int *futex)
|
||||
{
|
||||
return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
|
||||
}
|
||||
#define lll_mutex_trylock(lock) __lll_mutex_trylock (&(lock))
|
||||
|
||||
|
||||
static inline int __attribute__((always_inline))
|
||||
__lll_mutex_cond_trylock(int *futex)
|
||||
{
|
||||
return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
|
||||
}
|
||||
#define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock))
|
||||
|
||||
|
||||
extern void __lll_lock_wait (int *futex) attribute_hidden;
|
||||
|
||||
static inline void __attribute__((always_inline))
|
||||
__lll_mutex_lock(int *futex)
|
||||
{
|
||||
if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
|
||||
__lll_lock_wait (futex);
|
||||
}
|
||||
#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
|
||||
|
||||
|
||||
static inline void __attribute__ ((always_inline))
|
||||
__lll_mutex_cond_lock (int *futex)
|
||||
{
|
||||
if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
|
||||
__lll_lock_wait (futex);
|
||||
}
|
||||
#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
|
||||
|
||||
|
||||
extern int __lll_timedlock_wait (int *futex, const struct timespec *)
|
||||
attribute_hidden;
|
||||
|
||||
static inline int __attribute__ ((always_inline))
|
||||
__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
|
||||
{
|
||||
int result = 0;
|
||||
if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
|
||||
result = __lll_timedlock_wait (futex, abstime);
|
||||
return result;
|
||||
}
|
||||
#define lll_mutex_timedlock(futex, abstime) \
|
||||
__lll_mutex_timedlock (&(futex), abstime)
|
||||
|
||||
|
||||
static inline void __attribute__ ((always_inline))
|
||||
__lll_mutex_unlock (int *futex)
|
||||
{
|
||||
int val = atomic_exchange_rel (futex, 0);
|
||||
if (__builtin_expect (val > 1, 0))
|
||||
lll_futex_wake (futex, 1);
|
||||
}
|
||||
#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
|
||||
|
||||
|
||||
static inline void __attribute__ ((always_inline))
|
||||
__lll_mutex_unlock_force (int *futex)
|
||||
{
|
||||
(void) atomic_exchange_rel (futex, 0);
|
||||
lll_futex_wake (futex, 1);
|
||||
}
|
||||
#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
|
||||
|
||||
|
||||
#define lll_mutex_islocked(futex) \
|
||||
(futex != 0)
|
||||
|
||||
|
||||
/* Our internal lock implementation is identical to the binary-compatible
|
||||
mutex implementation. */
|
||||
|
||||
/* Type for lock object. */
|
||||
typedef int lll_lock_t;
|
||||
|
||||
/* Initializers for lock. */
|
||||
#define LLL_LOCK_INITIALIZER (0)
|
||||
#define LLL_LOCK_INITIALIZER_LOCKED (1)
|
||||
|
||||
extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
|
||||
|
||||
/* The states of a lock are:
|
||||
0 - untaken
|
||||
1 - taken by one user
|
||||
>1 - taken by more users */
|
||||
|
||||
#define lll_trylock(lock) lll_mutex_trylock (lock)
|
||||
#define lll_lock(lock) lll_mutex_lock (lock)
|
||||
#define lll_unlock(lock) lll_mutex_unlock (lock)
|
||||
#define lll_islocked(lock) lll_mutex_islocked (lock)
|
||||
|
||||
/* The kernel notifies a process which uses CLONE_CLEARTID via futex
|
||||
wakeup when the clone terminates. The memory location contains the
|
||||
thread ID while the clone is running and is reset to zero
|
||||
afterwards. */
|
||||
#define lll_wait_tid(tid) \
|
||||
do { \
|
||||
__typeof (tid) __tid; \
|
||||
while ((__tid = (tid)) != 0) \
|
||||
lll_futex_wait (&(tid), __tid); \
|
||||
} while (0)
|
||||
|
||||
extern int __lll_timedwait_tid (int *, const struct timespec *)
|
||||
attribute_hidden;
|
||||
|
||||
#define lll_timedwait_tid(tid, abstime) \
|
||||
({ \
|
||||
int __res = 0; \
|
||||
if ((tid) != 0) \
|
||||
__res = __lll_timedwait_tid (&(tid), (abstime)); \
|
||||
__res; \
|
||||
})
|
||||
|
||||
|
||||
/* Conditional variable handling. */
|
||||
|
||||
extern void __lll_cond_wait (pthread_cond_t *cond)
|
||||
attribute_hidden;
|
||||
extern int __lll_cond_timedwait (pthread_cond_t *cond,
|
||||
const struct timespec *abstime)
|
||||
attribute_hidden;
|
||||
extern void __lll_cond_wake (pthread_cond_t *cond)
|
||||
attribute_hidden;
|
||||
extern void __lll_cond_broadcast (pthread_cond_t *cond)
|
||||
attribute_hidden;
|
||||
|
||||
#define lll_cond_wait(cond) \
|
||||
__lll_cond_wait (cond)
|
||||
#define lll_cond_timedwait(cond, abstime) \
|
||||
__lll_cond_timedwait (cond, abstime)
|
||||
#define lll_cond_wake(cond) \
|
||||
__lll_cond_wake (cond)
|
||||
#define lll_cond_broadcast(cond) \
|
||||
__lll_cond_broadcast (cond)
|
||||
|
||||
#endif /* lowlevellock.h */
|
37
nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
Normal file
37
nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
Normal file
@ -0,0 +1,37 @@
|
||||
/* Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <tls.h>
|
||||
|
||||
/* Save the PID value. */
|
||||
#define SAVE_PID \
|
||||
READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \
|
||||
lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \
|
||||
subu a2, $0, a2; /* Negate it. */ \
|
||||
sw a2, PID_OFFSET(v1); /* Store the temporary PID. */
|
||||
|
||||
/* Restore the old PID value in the parent. */
|
||||
#define RESTORE_PID \
|
||||
beqz v0, 1f; /* If we are the parent... */ \
|
||||
READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \
|
||||
lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \
|
||||
subu a2, $0, a2; /* Re-negate it. */ \
|
||||
sw a2, PID_OFFSET(v1); /* Restore the PID. */ \
|
||||
1:
|
||||
|
||||
#include <../sysdeps/unix/sysv/linux/mips/vfork.S>
|
94
nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c
Normal file
94
nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c
Normal file
@ -0,0 +1,94 @@
|
||||
/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "pthreadP.h"
|
||||
#include <lowlevellock.h>
|
||||
|
||||
|
||||
unsigned long int __fork_generation attribute_hidden;
|
||||
|
||||
|
||||
static void
|
||||
clear_once_control (void *arg)
|
||||
{
|
||||
pthread_once_t *once_control = (pthread_once_t *) arg;
|
||||
|
||||
*once_control = 0;
|
||||
lll_futex_wake (once_control, INT_MAX);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
__pthread_once (once_control, init_routine)
|
||||
pthread_once_t *once_control;
|
||||
void (*init_routine) (void);
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
int oldval, val, newval;
|
||||
|
||||
val = *once_control;
|
||||
do
|
||||
{
|
||||
/* Check if the initialized has already been done. */
|
||||
if ((val & 2) != 0)
|
||||
return 0;
|
||||
|
||||
oldval = val;
|
||||
newval = (oldval & 3) | __fork_generation | 1;
|
||||
val = atomic_compare_and_exchange_val_acq (once_control, newval,
|
||||
oldval);
|
||||
}
|
||||
while (__builtin_expect (val != oldval, 0));
|
||||
|
||||
/* Check if another thread already runs the initializer. */
|
||||
if ((oldval & 1) != 0)
|
||||
{
|
||||
/* Check whether the initializer execution was interrupted
|
||||
by a fork. */
|
||||
if (((oldval ^ newval) & -4) == 0)
|
||||
{
|
||||
/* Same generation, some other thread was faster. Wait. */
|
||||
lll_futex_wait (once_control, newval);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* This thread is the first here. Do the initialization.
|
||||
Register a cleanup handler so that in case the thread gets
|
||||
interrupted the initialization can be restarted. */
|
||||
pthread_cleanup_push (clear_once_control, once_control);
|
||||
|
||||
init_routine ();
|
||||
|
||||
pthread_cleanup_pop (0);
|
||||
|
||||
|
||||
/* Add one to *once_control. */
|
||||
atomic_increment (once_control);
|
||||
|
||||
/* Wake up all other threads. */
|
||||
lll_futex_wake (once_control, INT_MAX);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
weak_alias (__pthread_once, pthread_once)
|
||||
strong_alias (__pthread_once, __pthread_once_internal)
|
170
nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
Normal file
170
nptl/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
Normal file
@ -0,0 +1,170 @@
|
||||
/* Copyright (C) 2003, 2004, 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
#include <sysdeps/generic/sysdep.h>
|
||||
#include <tls.h>
|
||||
#ifndef __ASSEMBLER__
|
||||
# include <nptl/pthreadP.h>
|
||||
#endif
|
||||
|
||||
#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
|
||||
|
||||
#ifdef __PIC__
|
||||
# undef PSEUDO
|
||||
# define PSEUDO(name, syscall_name, args) \
|
||||
.align 2; \
|
||||
L(pseudo_start): \
|
||||
cfi_startproc; \
|
||||
99: la t9,__syscall_error; \
|
||||
jr t9; \
|
||||
.type __##syscall_name##_nocancel, @function; \
|
||||
.globl __##syscall_name##_nocancel; \
|
||||
__##syscall_name##_nocancel: \
|
||||
.set noreorder; \
|
||||
.cpload t9; \
|
||||
li v0, SYS_ify(syscall_name); \
|
||||
syscall; \
|
||||
.set reorder; \
|
||||
bne a3, zero, SYSCALL_ERROR_LABEL; \
|
||||
ret; \
|
||||
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
||||
ENTRY (name) \
|
||||
.set noreorder; \
|
||||
.cpload t9; \
|
||||
.set reorder; \
|
||||
SINGLE_THREAD_P(v1); \
|
||||
bne zero, v1, L(pseudo_cancel); \
|
||||
.set noreorder; \
|
||||
li v0, SYS_ify(syscall_name); \
|
||||
syscall; \
|
||||
.set reorder; \
|
||||
bne a3, zero, SYSCALL_ERROR_LABEL; \
|
||||
ret; \
|
||||
L(pseudo_cancel): \
|
||||
SAVESTK_##args; \
|
||||
sw ra, 28(sp); \
|
||||
cfi_rel_offset (ra, 28); \
|
||||
sw gp, 32(sp); \
|
||||
cfi_rel_offset (gp, 32); \
|
||||
PUSHARGS_##args; /* save syscall args */ \
|
||||
CENABLE; \
|
||||
lw gp, 32(sp); \
|
||||
sw v0, 44(sp); /* save mask */ \
|
||||
POPARGS_##args; /* restore syscall args */ \
|
||||
.set noreorder; \
|
||||
li v0, SYS_ify (syscall_name); \
|
||||
syscall; \
|
||||
.set reorder; \
|
||||
sw v0, 36(sp); /* save syscall result */ \
|
||||
sw a3, 40(sp); /* save syscall error flag */ \
|
||||
lw a0, 44(sp); /* pass mask as arg1 */ \
|
||||
CDISABLE; \
|
||||
lw gp, 32(sp); \
|
||||
lw v0, 36(sp); /* restore syscall result */ \
|
||||
lw a3, 40(sp); /* restore syscall error flag */ \
|
||||
lw ra, 28(sp); /* restore return address */ \
|
||||
.set noreorder; \
|
||||
bne a3, zero, SYSCALL_ERROR_LABEL; \
|
||||
RESTORESTK; \
|
||||
L(pseudo_end): \
|
||||
.set reorder;
|
||||
|
||||
# undef PSEUDO_END
|
||||
# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
|
||||
|
||||
#endif
|
||||
|
||||
# define PUSHARGS_0 /* nothing to do */
|
||||
# define PUSHARGS_1 PUSHARGS_0 sw a0, 0(sp); cfi_rel_offset (a0, 0);
|
||||
# define PUSHARGS_2 PUSHARGS_1 sw a1, 4(sp); cfi_rel_offset (a1, 4);
|
||||
# define PUSHARGS_3 PUSHARGS_2 sw a2, 8(sp); cfi_rel_offset (a2, 8);
|
||||
# define PUSHARGS_4 PUSHARGS_3 sw a3, 12(sp); cfi_rel_offset (a3, 12);
|
||||
# define PUSHARGS_5 PUSHARGS_4 /* handled by SAVESTK_## */
|
||||
# define PUSHARGS_6 PUSHARGS_5
|
||||
# define PUSHARGS_7 PUSHARGS_6
|
||||
|
||||
# define POPARGS_0 /* nothing to do */
|
||||
# define POPARGS_1 POPARGS_0 lw a0, 0(sp);
|
||||
# define POPARGS_2 POPARGS_1 lw a1, 4(sp);
|
||||
# define POPARGS_3 POPARGS_2 lw a2, 8(sp);
|
||||
# define POPARGS_4 POPARGS_3 lw a3, 12(sp);
|
||||
# define POPARGS_5 POPARGS_4 /* args already in new stackframe */
|
||||
# define POPARGS_6 POPARGS_5
|
||||
# define POPARGS_7 POPARGS_6
|
||||
|
||||
|
||||
# define STKSPACE 48
|
||||
# define SAVESTK_0 subu sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE)
|
||||
# define SAVESTK_1 SAVESTK_0
|
||||
# define SAVESTK_2 SAVESTK_1
|
||||
# define SAVESTK_3 SAVESTK_2
|
||||
# define SAVESTK_4 SAVESTK_3
|
||||
# define SAVESTK_5 lw t0, 16(sp); \
|
||||
SAVESTK_0; \
|
||||
sw t0, 16(sp)
|
||||
|
||||
# define SAVESTK_6 lw t0, 16(sp); \
|
||||
lw t1, 20(sp); \
|
||||
SAVESTK_0; \
|
||||
sw t0, 16(sp); \
|
||||
sw t1, 20(sp)
|
||||
|
||||
# define SAVESTK_7 lw t0, 16(sp); \
|
||||
lw t1, 20(sp); \
|
||||
lw t2, 24(sp); \
|
||||
SAVESTK_0; \
|
||||
sw t0, 16(sp); \
|
||||
sw t1, 20(sp); \
|
||||
sw t2, 24(sp)
|
||||
|
||||
# define RESTORESTK addu sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
|
||||
|
||||
|
||||
/* We use jalr rather than jal. This means that the assembler will not
|
||||
automatically restore $gp (in case libc has multiple GOTs) so we must
|
||||
do it manually - which we have to do anyway since we don't use .cprestore.
|
||||
It also shuts up the assembler warning about not using .cprestore. */
|
||||
# ifdef IS_IN_libpthread
|
||||
# define CENABLE la t9, __pthread_enable_asynccancel; jalr t9;
|
||||
# define CDISABLE la t9, __pthread_disable_asynccancel; jalr t9;
|
||||
# elif defined IS_IN_librt
|
||||
# define CENABLE la t9, __librt_enable_asynccancel; jalr t9;
|
||||
# define CDISABLE la t9, __librt_disable_asynccancel; jalr t9;
|
||||
# else
|
||||
# define CENABLE la t9, __libc_enable_asynccancel; jalr t9;
|
||||
# define CDISABLE la t9, __libc_disable_asynccancel; jalr t9;
|
||||
# endif
|
||||
|
||||
# ifndef __ASSEMBLER__
|
||||
# define SINGLE_THREAD_P \
|
||||
__builtin_expect (THREAD_GETMEM (THREAD_SELF, \
|
||||
header.multiple_threads) \
|
||||
== 0, 1)
|
||||
# else
|
||||
# define SINGLE_THREAD_P(reg) \
|
||||
READ_THREAD_POINTER(reg); \
|
||||
lw reg, MULTIPLE_THREADS_OFFSET(reg)
|
||||
#endif
|
||||
|
||||
#elif !defined __ASSEMBLER__
|
||||
|
||||
# define SINGLE_THREAD_P 1
|
||||
# define NO_CANCELLATION 1
|
||||
|
||||
#endif
|
42
nptl/sysdeps/unix/sysv/linux/mips/vfork.S
Normal file
42
nptl/sysdeps/unix/sysv/linux/mips/vfork.S
Normal file
@ -0,0 +1,42 @@
|
||||
/* Copyright (C) 2005 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <tls.h>
|
||||
|
||||
/* Save the PID value. */
|
||||
#define SAVE_PID \
|
||||
READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \
|
||||
lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \
|
||||
subu a2, $0, a2; /* Negate it. */ \
|
||||
bnez a2, 1f; /* If it was zero... */ \
|
||||
lui a2, 0x8000; /* use 0x80000000 instead. */ \
|
||||
1: sw a2, PID_OFFSET(v1); /* Store the temporary PID. */
|
||||
|
||||
/* Restore the old PID value in the parent. */
|
||||
#define RESTORE_PID \
|
||||
beqz v0, 1f; /* If we are the parent... */ \
|
||||
READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \
|
||||
lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \
|
||||
subu a2, $0, a2; /* Re-negate it. */ \
|
||||
lui a0, 0x8000; /* Load 0x80000000... */ \
|
||||
bne a2, a0, 2f; /* ... compare against it... */ \
|
||||
li a2, 0; /* ... use 0 instead. */ \
|
||||
2: sw a2, PID_OFFSET(v1); /* Restore the PID. */ \
|
||||
1:
|
||||
|
||||
#include <../sysdeps/unix/sysv/linux/mips/vfork.S>
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -48,12 +48,16 @@ __lll_mutex_lock_wait:
|
||||
|
||||
xorq %r10, %r10 /* No timeout. */
|
||||
movl $2, %edx
|
||||
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
|
||||
cmpl %edx, %eax /* NB: %edx == 2 */
|
||||
jne 2f
|
||||
|
||||
1: movq $SYS_futex, %rax
|
||||
1: movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
2: movl %edx, %eax
|
||||
@ -93,7 +97,7 @@ __lll_mutex_timedlock_wait:
|
||||
1:
|
||||
/* Get current time. */
|
||||
movq %rsp, %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
/* This is a regular function call, all caller-save registers
|
||||
might be clobbered. */
|
||||
@ -101,7 +105,7 @@ __lll_mutex_timedlock_wait:
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 8(%rsp), %rax
|
||||
movq $1000, %rdi
|
||||
movl $1000, %edi
|
||||
mul %rdi /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rdi
|
||||
movq 8(%r13), %rsi
|
||||
@ -126,9 +130,13 @@ __lll_mutex_timedlock_wait:
|
||||
je 8f
|
||||
|
||||
movq %rsp, %r10
|
||||
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movq %r12, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
movq %rax, %rcx
|
||||
|
||||
@ -195,9 +203,9 @@ __lll_mutex_unlock_wake:
|
||||
pushq %rdx
|
||||
|
||||
movl $0, (%rdi)
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $1, %edx /* Wake one thread. */
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
popq %rdx
|
||||
@ -222,13 +230,13 @@ __lll_timedwait_tid:
|
||||
|
||||
/* Get current time. */
|
||||
2: movq %rsp, %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
callq *%rax
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 8(%rsp), %rax
|
||||
movq $1000, %rdi
|
||||
movl $1000, %edi
|
||||
mul %rdi /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rdi
|
||||
movq 8(%r13), %rsi
|
||||
@ -248,9 +256,13 @@ __lll_timedwait_tid:
|
||||
jz 4f
|
||||
|
||||
movq %rsp, %r10
|
||||
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movq %r12, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
cmpl $0, (%rdi)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -63,9 +63,14 @@ pthread_barrier_wait:
|
||||
|
||||
/* Wait for the remaining threads. The call will return immediately
|
||||
if the CURR_EVENT memory has meanwhile been changed. */
|
||||
7: xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
7:
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
xorq %r10, %r10
|
||||
8: movq $SYS_futex, %rax
|
||||
8: movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
/* Don't return on spurious wakeups. The syscall does not change
|
||||
@ -110,8 +115,8 @@ pthread_barrier_wait:
|
||||
/* Wake up all waiters. The count is a signed number in the kernel
|
||||
so 0x7fffffff is the highest value. */
|
||||
movl $0x7fffffff, %edx
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movq $SYS_futex, %rax
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
/* Increment LEFT. If this brings the count back to the
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -81,10 +81,10 @@ __pthread_cond_broadcast:
|
||||
je 9f
|
||||
|
||||
/* Wake up all threads. */
|
||||
movq $FUTEX_CMP_REQUEUE, %rsi
|
||||
movq $SYS_futex, %rax
|
||||
movl $FUTEX_CMP_REQUEUE, %esi
|
||||
movl $SYS_futex, %eax
|
||||
movl $1, %edx
|
||||
movq $0x7fffffff, %r10
|
||||
movl $0x7fffffff, %r10d
|
||||
syscall
|
||||
|
||||
/* For any kind of error, which mainly is EAGAIN, we try again
|
||||
@ -128,9 +128,9 @@ __pthread_cond_broadcast:
|
||||
jmp 8b
|
||||
|
||||
9: /* The futex requeue functionality is not available. */
|
||||
movq $0x7fffffff, %rdx
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movq $SYS_futex, %rax
|
||||
movl $0x7fffffff, %edx
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
jmp 10b
|
||||
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -66,9 +66,9 @@ __pthread_cond_signal:
|
||||
addl $1, (%rdi)
|
||||
|
||||
/* Wake up one thread. */
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movq $SYS_futex, %rax
|
||||
movq $1, %rdx
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $SYS_futex, %eax
|
||||
movl $1, %edx
|
||||
syscall
|
||||
|
||||
/* Unlock. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -56,7 +56,7 @@ __pthread_cond_timedwait:
|
||||
.Lsubq:
|
||||
|
||||
cmpq $1000000000, 8(%rdx)
|
||||
movq $EINVAL, %rax
|
||||
movl $EINVAL, %eax
|
||||
jae 18f
|
||||
|
||||
/* Stack frame:
|
||||
@ -102,7 +102,7 @@ __pthread_cond_timedwait:
|
||||
|
||||
/* Unlock the mutex. */
|
||||
2: movq 16(%rsp), %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
callq __pthread_mutex_unlock_usercnt
|
||||
|
||||
testl %eax, %eax
|
||||
@ -141,7 +141,7 @@ __pthread_cond_timedwait:
|
||||
/* Only clocks 0 and 1 are allowed so far. Both are handled in the
|
||||
kernel. */
|
||||
leaq 24(%rsp), %rsi
|
||||
movq $__NR_clock_gettime, %rax
|
||||
movl $__NR_clock_gettime, %eax
|
||||
syscall
|
||||
# ifndef __ASSUME_POSIX_TIMERS
|
||||
cmpq $-ENOSYS, %rax
|
||||
@ -155,13 +155,13 @@ __pthread_cond_timedwait:
|
||||
subq 32(%rsp), %rdx
|
||||
#else
|
||||
leaq 24(%rsp), %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
callq *%rax
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 32(%rsp), %rax
|
||||
movq $1000, %rdx
|
||||
movl $1000, %edx
|
||||
mul %rdx /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rcx
|
||||
movq 8(%r13), %rdx
|
||||
@ -195,10 +195,14 @@ __pthread_cond_timedwait:
|
||||
movl %eax, (%rsp)
|
||||
|
||||
leaq 24(%rsp), %r10
|
||||
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movq %r12, %rdx
|
||||
addq $cond_futex, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
movq %rax, %r14
|
||||
|
||||
@ -237,7 +241,7 @@ __pthread_cond_timedwait:
|
||||
|
||||
13: incq wakeup_seq(%rdi)
|
||||
incl cond_futex(%rdi)
|
||||
movq $ETIMEDOUT, %r14
|
||||
movl $ETIMEDOUT, %r14d
|
||||
jmp 14f
|
||||
|
||||
23: xorq %r14, %r14
|
||||
@ -256,8 +260,8 @@ __pthread_cond_timedwait:
|
||||
jne 25f
|
||||
|
||||
addq $cond_nwaiters, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movl $SYS_futex, %eax
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $1, %edx
|
||||
syscall
|
||||
subq $cond_nwaiters, %rdi
|
||||
@ -349,13 +353,13 @@ __pthread_cond_timedwait:
|
||||
#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
|
||||
/* clock_gettime not available. */
|
||||
19: leaq 24(%rsp), %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
callq *%rax
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 32(%rsp), %rax
|
||||
movq $1000, %rdx
|
||||
movl $1000, %edx
|
||||
mul %rdx /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rcx
|
||||
movq 8(%r13), %rdx
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -82,12 +82,12 @@ __condvar_cleanup:
|
||||
jne 4f
|
||||
|
||||
addq $cond_nwaiters, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movl $SYS_futex, %eax
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $1, %edx
|
||||
syscall
|
||||
subq $cond_nwaiters, %rdi
|
||||
movq $1, %r12
|
||||
movl $1, %r12d
|
||||
|
||||
4: LOCK
|
||||
#if cond_lock == 0
|
||||
@ -105,9 +105,9 @@ __condvar_cleanup:
|
||||
2: testq %r12, %r12
|
||||
jnz 5f
|
||||
addq $cond_futex, %rdi
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $0x7fffffff, %edx
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
5: movq 16(%r8), %rdi
|
||||
@ -170,7 +170,7 @@ __pthread_cond_wait:
|
||||
|
||||
/* Unlock the mutex. */
|
||||
2: movq 16(%rsp), %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
callq __pthread_mutex_unlock_usercnt
|
||||
|
||||
testl %eax, %eax
|
||||
@ -215,8 +215,12 @@ __pthread_cond_wait:
|
||||
xorq %r10, %r10
|
||||
movq %r12, %rdx
|
||||
addq $cond_futex-cond_lock, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
movl $SYS_futex, %eax
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
syscall
|
||||
|
||||
movl (%rsp), %edi
|
||||
@ -262,8 +266,8 @@ __pthread_cond_wait:
|
||||
jne 17f
|
||||
|
||||
addq $cond_nwaiters, %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movl $SYS_futex, %eax
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $1, %edx
|
||||
syscall
|
||||
subq $cond_nwaiters, %rdi
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -74,8 +74,12 @@ __pthread_once:
|
||||
jnz 3f /* Different for generation -> run initializer. */
|
||||
|
||||
/* Somebody else got here first. Wait. */
|
||||
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
movq $SYS_futex, %rax
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
jmp 6b
|
||||
|
||||
@ -98,12 +102,12 @@ __pthread_once:
|
||||
/* Wake up all other threads. */
|
||||
movl $0x7fffffff, %edx
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
4: addq $8, %rsp
|
||||
.Ladd:
|
||||
xorq %rax, %rax
|
||||
xorl %eax, %eax
|
||||
retq
|
||||
|
||||
.size __pthread_once,.-__pthread_once
|
||||
@ -124,8 +128,8 @@ clear_once_control:
|
||||
movl $0, (%rdi)
|
||||
|
||||
movl $0x7fffffff, %edx
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movq $SYS_futex, %rax
|
||||
movl $FUTEX_WAKE, %esi
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
movq %r8, %rdi
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -74,8 +74,12 @@ __pthread_rwlock_rdlock:
|
||||
jne 10f
|
||||
|
||||
11: addq $READERS_WAKEUP, %rdi
|
||||
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
movq $SYS_futex, %rax
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
subq $READERS_WAKEUP, %rdi
|
||||
@ -94,7 +98,7 @@ __pthread_rwlock_rdlock:
|
||||
13: decl READERS_QUEUED(%rdi)
|
||||
jmp 2b
|
||||
|
||||
5: xorq %rdx, %rdx
|
||||
5: xorl %edx, %edx
|
||||
incl NR_READERS(%rdi)
|
||||
je 8f
|
||||
9: LOCK
|
||||
@ -122,7 +126,7 @@ __pthread_rwlock_rdlock:
|
||||
14: cmpl %fs:TID, %eax
|
||||
jne 3b
|
||||
/* Deadlock detected. */
|
||||
movq $EDEADLK, %rdx
|
||||
movl $EDEADLK, %edx
|
||||
jmp 9b
|
||||
|
||||
6:
|
||||
@ -137,12 +141,12 @@ __pthread_rwlock_rdlock:
|
||||
|
||||
/* Overflow. */
|
||||
8: decl NR_READERS(%rdi)
|
||||
movq $EAGAIN, %rdx
|
||||
movl $EAGAIN, %edx
|
||||
jmp 9b
|
||||
|
||||
/* Overflow. */
|
||||
4: decl READERS_QUEUED(%rdi)
|
||||
movq $EAGAIN, %rdx
|
||||
movl $EAGAIN, %edx
|
||||
jmp 9b
|
||||
|
||||
10:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -90,13 +90,13 @@ pthread_rwlock_timedrdlock:
|
||||
|
||||
/* Get current time. */
|
||||
11: movq %rsp, %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
callq *%rax
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 8(%rsp), %rax
|
||||
movq $1000, %rdi
|
||||
movl $1000, %edi
|
||||
mul %rdi /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rcx
|
||||
movq 8(%r13), %rdi
|
||||
@ -112,11 +112,15 @@ pthread_rwlock_timedrdlock:
|
||||
movq %rcx, (%rsp) /* Store relative timeout. */
|
||||
movq %rdi, 8(%rsp)
|
||||
|
||||
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movq %rsp, %r10
|
||||
movl %r14d, %edx
|
||||
leaq READERS_WAKEUP(%r12), %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
movq %rax, %rdx
|
||||
17:
|
||||
@ -136,11 +140,11 @@ pthread_rwlock_timedrdlock:
|
||||
cmpq $-ETIMEDOUT, %rdx
|
||||
jne 2b
|
||||
|
||||
18: movq $ETIMEDOUT, %rdx
|
||||
18: movl $ETIMEDOUT, %edx
|
||||
jmp 9f
|
||||
|
||||
|
||||
5: xorq %rdx, %rdx
|
||||
5: xorl %edx, %edx
|
||||
incl NR_READERS(%r12)
|
||||
je 8f
|
||||
9: LOCK
|
||||
@ -168,7 +172,7 @@ pthread_rwlock_timedrdlock:
|
||||
|
||||
14: cmpl %fs:TID, %eax
|
||||
jne 3b
|
||||
movq $EDEADLK, %rdx
|
||||
movl $EDEADLK, %edx
|
||||
jmp 9b
|
||||
|
||||
6:
|
||||
@ -182,12 +186,12 @@ pthread_rwlock_timedrdlock:
|
||||
|
||||
/* Overflow. */
|
||||
8: decl NR_READERS(%r12)
|
||||
movq $EAGAIN, %rdx
|
||||
movl $EAGAIN, %edx
|
||||
jmp 9b
|
||||
|
||||
/* Overflow. */
|
||||
4: decl READERS_QUEUED(%r12)
|
||||
movq $EAGAIN, %rdx
|
||||
movl $EAGAIN, %edx
|
||||
jmp 9b
|
||||
|
||||
10:
|
||||
@ -211,6 +215,6 @@ pthread_rwlock_timedrdlock:
|
||||
16: movq $-ETIMEDOUT, %rdx
|
||||
jmp 17b
|
||||
|
||||
19: movq $EINVAL, %rdx
|
||||
19: movl $EINVAL, %edx
|
||||
jmp 9b
|
||||
.size pthread_rwlock_timedrdlock,.-pthread_rwlock_timedrdlock
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -86,13 +86,13 @@ pthread_rwlock_timedwrlock:
|
||||
|
||||
/* Get current time. */
|
||||
11: movq %rsp, %rdi
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
callq *%rax
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 8(%rsp), %rax
|
||||
movq $1000, %rdi
|
||||
movl $1000, %edi
|
||||
mul %rdi /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rcx
|
||||
movq 8(%r13), %rdi
|
||||
@ -108,11 +108,15 @@ pthread_rwlock_timedwrlock:
|
||||
movq %rcx, (%rsp) /* Store relative timeout. */
|
||||
movq %rdi, 8(%rsp)
|
||||
|
||||
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movq %rsp, %r10
|
||||
movl %r14d, %edx
|
||||
leaq WRITERS_WAKEUP(%r12), %rdi
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
movq %rax, %rdx
|
||||
17:
|
||||
@ -132,11 +136,11 @@ pthread_rwlock_timedwrlock:
|
||||
cmpq $-ETIMEDOUT, %rdx
|
||||
jne 2b
|
||||
|
||||
18: movq $ETIMEDOUT, %rdx
|
||||
18: movl $ETIMEDOUT, %edx
|
||||
jmp 9f
|
||||
|
||||
|
||||
5: xorq %rdx, %rdx
|
||||
5: xorl %edx, %edx
|
||||
movl %fs:TID, %eax
|
||||
movl %eax, WRITER(%r12)
|
||||
9: LOCK
|
||||
@ -164,7 +168,7 @@ pthread_rwlock_timedwrlock:
|
||||
|
||||
14: cmpl %fs:TID, %eax
|
||||
jne 3b
|
||||
20: movq $EDEADLK, %rdx
|
||||
20: movl $EDEADLK, %edx
|
||||
jmp 9b
|
||||
|
||||
6:
|
||||
@ -178,7 +182,7 @@ pthread_rwlock_timedwrlock:
|
||||
|
||||
/* Overflow. */
|
||||
4: decl WRITERS_QUEUED(%r12)
|
||||
movq $EAGAIN, %rdx
|
||||
movl $EAGAIN, %edx
|
||||
jmp 9b
|
||||
|
||||
10:
|
||||
@ -202,6 +206,6 @@ pthread_rwlock_timedwrlock:
|
||||
16: movq $-ETIMEDOUT, %rdx
|
||||
jmp 17b
|
||||
|
||||
19: movq $EINVAL, %rdx
|
||||
19: movl $EINVAL, %edx
|
||||
jmp 9b
|
||||
.size pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -56,7 +56,7 @@ __pthread_rwlock_unlock:
|
||||
|
||||
5: movl $0, WRITER(%rdi)
|
||||
|
||||
movq $1, %rsi
|
||||
movl $1, %esi
|
||||
leaq WRITERS_WAKEUP(%rdi), %r10
|
||||
movq %rsi, %rdx
|
||||
cmpl $0, WRITERS_QUEUED(%rdi)
|
||||
@ -78,11 +78,11 @@ __pthread_rwlock_unlock:
|
||||
#endif
|
||||
jne 7f
|
||||
|
||||
8: movq $SYS_futex, %rax
|
||||
8: movl $SYS_futex, %eax
|
||||
movq %r10, %rdi
|
||||
syscall
|
||||
|
||||
xorq %rax, %rax
|
||||
xorl %eax, %eax
|
||||
retq
|
||||
|
||||
.align 16
|
||||
@ -94,7 +94,7 @@ __pthread_rwlock_unlock:
|
||||
#endif
|
||||
jne 3f
|
||||
|
||||
4: xorq %rax, %rax
|
||||
4: xorl %eax, %eax
|
||||
retq
|
||||
|
||||
1:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -72,8 +72,12 @@ __pthread_rwlock_wrlock:
|
||||
jne 10f
|
||||
|
||||
11: addq $WRITERS_WAKEUP, %rdi
|
||||
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
|
||||
movq $SYS_futex, %rax
|
||||
#if FUTEX_WAIT == 0
|
||||
xorl %esi, %esi
|
||||
#else
|
||||
movl $FUTEX_WAIT, %esi
|
||||
#endif
|
||||
movl $SYS_futex, %eax
|
||||
syscall
|
||||
|
||||
subq $WRITERS_WAKEUP, %rdi
|
||||
@ -92,7 +96,7 @@ __pthread_rwlock_wrlock:
|
||||
13: decl WRITERS_QUEUED(%rdi)
|
||||
jmp 2b
|
||||
|
||||
5: xorq %rdx, %rdx
|
||||
5: xorl %edx, %edx
|
||||
movl %fs:TID, %eax
|
||||
movl %eax, WRITER(%rdi)
|
||||
9: LOCK
|
||||
@ -119,7 +123,7 @@ __pthread_rwlock_wrlock:
|
||||
|
||||
14: cmpl %fs:TID, %eax
|
||||
jne 3b
|
||||
movq $EDEADLK, %rdx
|
||||
movl $EDEADLK, %edx
|
||||
jmp 9b
|
||||
|
||||
6:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -41,8 +41,8 @@ sem_post:
|
||||
LOCK
|
||||
xaddl %edx, (%rdi)
|
||||
|
||||
movq $SYS_futex, %rax
|
||||
movq $FUTEX_WAKE, %rsi
|
||||
movl $SYS_futex, %eax
|
||||
movl $FUTEX_WAKE, %esi
|
||||
incl %edx
|
||||
syscall
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -82,14 +82,14 @@ sem_timedwait:
|
||||
7: call __pthread_enable_asynccancel
|
||||
movl %eax, 16(%rsp)
|
||||
|
||||
xorq %rsi, %rsi
|
||||
xorl %esi, %esi
|
||||
movq %rsp, %rdi
|
||||
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
||||
callq *%rax
|
||||
|
||||
/* Compute relative timeout. */
|
||||
movq 8(%rsp), %rax
|
||||
movq $1000, %rdi
|
||||
movl $1000, %edi
|
||||
mul %rdi /* Milli seconds to nano seconds. */
|
||||
movq (%r13), %rdi
|
||||
movq 8(%r13), %rsi
|
||||
@ -107,8 +107,8 @@ sem_timedwait:
|
||||
|
||||
movq %rsp, %r10
|
||||
movq %r12, %rdi
|
||||
xorq %rsi, %rsi
|
||||
movq $SYS_futex, %rax
|
||||
xorl %esi, %esi
|
||||
movl $SYS_futex, %eax
|
||||
xorl %edx, %edx
|
||||
syscall
|
||||
movq %rax, %r14
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -77,7 +77,7 @@ sem_wait:
|
||||
movl %eax, %r8d
|
||||
|
||||
xorq %r10, %r10
|
||||
movq $SYS_futex, %rax
|
||||
movl $SYS_futex, %eax
|
||||
movq %r13, %rdi
|
||||
movq %r10, %rsi
|
||||
movq %r10, %rdx
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
POPARGS_##args \
|
||||
/* The return value from CENABLE is argument for CDISABLE. */ \
|
||||
movq %rax, (%rsp); \
|
||||
movq $SYS_ify (syscall_name), %rax; \
|
||||
movl $SYS_ify (syscall_name), %eax; \
|
||||
syscall; \
|
||||
movq (%rsp), %rdi; \
|
||||
/* Save %rax since it's the error code from the syscall. */ \
|
||||
|
@ -327,31 +327,74 @@ fnmatch (pattern, string, flags)
|
||||
{
|
||||
mbstate_t ps;
|
||||
size_t n;
|
||||
const char *p;
|
||||
wchar_t *wpattern;
|
||||
wchar_t *wstring;
|
||||
|
||||
/* Convert the strings into wide characters. */
|
||||
memset (&ps, '\0', sizeof (ps));
|
||||
n = mbsrtowcs (NULL, &pattern, 0, &ps);
|
||||
if (__builtin_expect (n == (size_t) -1, 0))
|
||||
/* Something wrong.
|
||||
XXX Do we have to set `errno' to something which mbsrtows hasn't
|
||||
already done? */
|
||||
return -1;
|
||||
wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
|
||||
assert (mbsinit (&ps));
|
||||
(void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
|
||||
p = pattern;
|
||||
#ifdef _LIBC
|
||||
n = strnlen (pattern, 1024);
|
||||
#else
|
||||
n = strlen (pattern);
|
||||
#endif
|
||||
if (__builtin_expect (n < 1024, 1))
|
||||
{
|
||||
wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
|
||||
n = mbsrtowcs (wpattern, &p, n + 1, &ps);
|
||||
if (__builtin_expect (n == (size_t) -1, 0))
|
||||
/* Something wrong.
|
||||
XXX Do we have to set `errno' to something which mbsrtows hasn't
|
||||
already done? */
|
||||
return -1;
|
||||
if (p)
|
||||
memset (&ps, '\0', sizeof (ps));
|
||||
}
|
||||
if (__builtin_expect (p != NULL, 0))
|
||||
{
|
||||
n = mbsrtowcs (NULL, &pattern, 0, &ps);
|
||||
if (__builtin_expect (n == (size_t) -1, 0))
|
||||
/* Something wrong.
|
||||
XXX Do we have to set `errno' to something which mbsrtows hasn't
|
||||
already done? */
|
||||
return -1;
|
||||
wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
|
||||
assert (mbsinit (&ps));
|
||||
(void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
|
||||
}
|
||||
|
||||
assert (mbsinit (&ps));
|
||||
n = mbsrtowcs (NULL, &string, 0, &ps);
|
||||
if (__builtin_expect (n == (size_t) -1, 0))
|
||||
/* Something wrong.
|
||||
XXX Do we have to set `errno' to something which mbsrtows hasn't
|
||||
already done? */
|
||||
return -1;
|
||||
wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
|
||||
assert (mbsinit (&ps));
|
||||
(void) mbsrtowcs (wstring, &string, n + 1, &ps);
|
||||
#ifdef _LIBC
|
||||
n = strnlen (string, 1024);
|
||||
#else
|
||||
n = strlen (string);
|
||||
#endif
|
||||
p = string;
|
||||
if (__builtin_expect (n < 1024, 1))
|
||||
{
|
||||
wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
|
||||
n = mbsrtowcs (wstring, &p, n + 1, &ps);
|
||||
if (__builtin_expect (n == (size_t) -1, 0))
|
||||
/* Something wrong.
|
||||
XXX Do we have to set `errno' to something which mbsrtows hasn't
|
||||
already done? */
|
||||
return -1;
|
||||
if (p)
|
||||
memset (&ps, '\0', sizeof (ps));
|
||||
}
|
||||
if (__builtin_expect (p != NULL, 0))
|
||||
{
|
||||
n = mbsrtowcs (NULL, &string, 0, &ps);
|
||||
if (__builtin_expect (n == (size_t) -1, 0))
|
||||
/* Something wrong.
|
||||
XXX Do we have to set `errno' to something which mbsrtows hasn't
|
||||
already done? */
|
||||
return -1;
|
||||
wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
|
||||
assert (mbsinit (&ps));
|
||||
(void) mbsrtowcs (wstring, &string, n + 1, &ps);
|
||||
}
|
||||
|
||||
return internal_fnwmatch (wpattern, wstring, wstring + n,
|
||||
flags & FNM_PERIOD, flags);
|
||||
|
@ -6,8 +6,9 @@ static int
|
||||
do_test (void)
|
||||
{
|
||||
static const char prog[] = "does-not-exist";
|
||||
char *env [] = {"FOO=BAR", NULL};
|
||||
errno = 0;
|
||||
execle (prog, prog, NULL, "FOO=BAR", NULL);
|
||||
execle (prog, prog, NULL, env);
|
||||
|
||||
if (errno != ENOENT)
|
||||
{
|
||||
|
@ -45,8 +45,9 @@ prepare (int argc, char *argv[])
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
char *env[] = {"FOO=BAR", NULL};
|
||||
errno = 0;
|
||||
execle (copy, copy, NULL, "FOO=BAR", NULL);
|
||||
execle (copy, copy, NULL, env);
|
||||
|
||||
if (errno != EACCES)
|
||||
{
|
||||
|
@ -195,6 +195,10 @@ struct La_s390_64_regs;
|
||||
struct La_s390_64_retval;
|
||||
struct La_ia64_regs;
|
||||
struct La_ia64_retval;
|
||||
struct La_mips_32_regs;
|
||||
struct La_mips_32_retval;
|
||||
struct La_mips_64_regs;
|
||||
struct La_mips_64_retval;
|
||||
|
||||
struct audit_ifaces
|
||||
{
|
||||
@ -251,6 +255,21 @@ struct audit_ifaces
|
||||
uintptr_t *, struct La_ia64_regs *,
|
||||
unsigned int *, const char *name,
|
||||
long int *framesizep);
|
||||
Elf32_Addr (*mips_o32_gnu_pltenter) (Elf32_Sym *, unsigned int,
|
||||
uintptr_t *, uintptr_t *,
|
||||
const struct La_mips_32_regs *,
|
||||
unsigned int *, const char *name,
|
||||
long int *framesizep);
|
||||
Elf32_Addr (*mips_n32_gnu_pltenter) (Elf32_Sym *, unsigned int,
|
||||
uintptr_t *, uintptr_t *,
|
||||
const struct La_mips_64_regs *,
|
||||
unsigned int *, const char *name,
|
||||
long int *framesizep);
|
||||
Elf64_Addr (*mips_n64_gnu_pltenter) (Elf64_Sym *, unsigned int,
|
||||
uintptr_t *, uintptr_t *,
|
||||
const struct La_mips_64_regs *,
|
||||
unsigned int *, const char *name,
|
||||
long int *framesizep);
|
||||
};
|
||||
union
|
||||
{
|
||||
@ -294,6 +313,21 @@ struct audit_ifaces
|
||||
uintptr_t *,
|
||||
const struct La_ia64_regs *,
|
||||
struct La_ia64_retval *, const char *);
|
||||
unsigned int (*mips_o32_gnu_pltexit) (Elf32_Sym *, unsigned int,
|
||||
uintptr_t *, uintptr_t *,
|
||||
const struct La_mips_32_regs *,
|
||||
struct La_mips_32_retval *,
|
||||
const char *);
|
||||
unsigned int (*mips_n32_gnu_pltexit) (Elf32_Sym *, unsigned int,
|
||||
uintptr_t *, uintptr_t *,
|
||||
const struct La_mips_64_regs *,
|
||||
struct La_mips_64_retval *,
|
||||
const char *);
|
||||
unsigned int (*mips_n64_gnu_pltexit) (Elf64_Sym *, unsigned int,
|
||||
uintptr_t *, uintptr_t *,
|
||||
const struct La_mips_64_regs *,
|
||||
struct La_mips_64_retval *,
|
||||
const char *);
|
||||
};
|
||||
unsigned int (*objclose) (uintptr_t *);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Convert string representing a number to integer value, using given locale.
|
||||
Copyright (C) 1997, 2002, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -27,4 +27,4 @@
|
||||
extern unsigned long int ____wcstoul_l_internal (const wchar_t *, wchar_t **,
|
||||
int, int, __locale_t);
|
||||
|
||||
#include <wcstol_l.c>
|
||||
#include "wcstol_l.c"
|
||||
|
@ -27,7 +27,8 @@ sysdep_routines += libc_libm_error libm_frexp libm_frexpf libm_frexpl \
|
||||
$(duplicated-routines)
|
||||
|
||||
sysdep-CPPFLAGS += -include libm-symbols.h \
|
||||
-D__POSIX__ \
|
||||
-D__POSIX__ -Dopensource \
|
||||
-D_LIB_VERSIONIMF=_LIB_VERSION \
|
||||
-DSIZE_INT_32 -DSIZE_LONG_INT_64 -DSIZE_LONG_LONG_INT_64
|
||||
-DSIZE_INT_32 -DSIZE_LONG_INT_64 -DSIZE_LONG_LONG_INT_64 \
|
||||
-DSIZE_LONG_64 -DIA64
|
||||
endif
|
||||
|
@ -824,6 +824,7 @@ acos_abs_gt_1:
|
||||
GLOBAL_LIBM_END(acos)
|
||||
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -601,6 +601,7 @@ ACOSF_ABS_ONE:
|
||||
|
||||
GLOBAL_LIBM_END(acosf)
|
||||
|
||||
|
||||
// Stack operations when calling error support.
|
||||
// (1) (2)
|
||||
// sp -> + psp -> +
|
||||
|
@ -1139,6 +1139,7 @@ ACOSH_LESS_ONE:
|
||||
|
||||
GLOBAL_LIBM_END(acosh)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
|
||||
|
@ -968,6 +968,7 @@ ACOSH_LESS_ONE:
|
||||
|
||||
GLOBAL_LIBM_END(acoshf)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
|
||||
|
@ -1650,6 +1650,7 @@ acoshl_lt_pone:
|
||||
GLOBAL_LIBM_END(acoshl)
|
||||
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -35,7 +35,7 @@
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http: //www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
// http://www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
//
|
||||
// History
|
||||
//==============================================================
|
||||
@ -2482,6 +2482,7 @@ acosl_SPECIAL_CASES:
|
||||
|
||||
GLOBAL_LIBM_END(acosl)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
// (1)
|
||||
|
@ -800,6 +800,7 @@ asin_abs_gt_1:
|
||||
GLOBAL_LIBM_END(asin)
|
||||
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -583,6 +583,7 @@ ASINF_ABS_ONE:
|
||||
;;
|
||||
|
||||
GLOBAL_LIBM_END(asinf)
|
||||
|
||||
// Stack operations when calling error support.
|
||||
// (1) (2)
|
||||
// sp -> + psp -> +
|
||||
|
@ -35,7 +35,7 @@
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http: //www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
// http://www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
//
|
||||
// History
|
||||
//==============================================================
|
||||
@ -2459,6 +2459,7 @@ SMALL_S:
|
||||
GLOBAL_LIBM_END(asinl)
|
||||
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
// (1)
|
||||
|
@ -52,6 +52,7 @@
|
||||
// 08/20/02 Corrected inexact flag and directed rounding symmetry bugs
|
||||
// 02/06/03 Reordered header: .section, .global, .proc, .align
|
||||
// 04/17/03 Added missing mutex directive
|
||||
// 12/23/03 atan2(NaN1,NaN2) now QNaN1, for consistency with atan2f, atan2l
|
||||
//
|
||||
// API
|
||||
//==============================================================
|
||||
@ -142,7 +143,7 @@
|
||||
// -0 -0 -pi
|
||||
//
|
||||
// Nan anything quiet Y
|
||||
// anything NaN quiet X
|
||||
// Not NaN NaN quiet X
|
||||
|
||||
// atan2(+-0/+-0) sets double error tag to 37
|
||||
|
||||
@ -388,7 +389,7 @@ GLOBAL_IEEE754_ENTRY(atan2)
|
||||
}
|
||||
{ .mfb
|
||||
ldfe atan2_P21 = [EXP_AD_P2],16
|
||||
(p10) fma.d.s0 f8 = atan2_Y,atan2_X,f0 // If y=nan, result quietized y
|
||||
(p10) fma.d.s0 f8 = atan2_X,atan2_Y,f0 // If y=nan, result quietized y
|
||||
(p10) br.ret.spnt b0 // Exit if y=nan
|
||||
;;
|
||||
}
|
||||
@ -985,6 +986,7 @@ ATAN2_ERROR:
|
||||
}
|
||||
GLOBAL_IEEE754_END(atan2)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
// (1)
|
||||
|
@ -827,6 +827,7 @@ ATAN2F_XY_INF_NAN_ZERO:
|
||||
|
||||
GLOBAL_IEEE754_END(atan2f)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
mov GR_Parameter_TAG = 38
|
||||
|
@ -1008,6 +1008,7 @@ atanh_ge_one:
|
||||
|
||||
GLOBAL_LIBM_END(atanh)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
|
||||
|
@ -782,6 +782,7 @@ atanhf_ge_one:
|
||||
|
||||
GLOBAL_LIBM_END(atanhf)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
|
||||
|
@ -1101,6 +1101,7 @@ atanhl_gt_one:
|
||||
};;
|
||||
|
||||
GLOBAL_LIBM_END(atanhl)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -811,6 +811,7 @@ COSH_UNORM:
|
||||
|
||||
GLOBAL_IEEE754_END(cosh)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -652,6 +652,7 @@ COSH_UNORM:
|
||||
|
||||
GLOBAL_IEEE754_END(coshf)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -1033,6 +1033,7 @@ COSH_HUGE:
|
||||
|
||||
GLOBAL_IEEE754_END(coshl)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
.file "exp.s"
|
||||
|
||||
|
||||
// Copyright (c) 2000 - 2002, Intel Corporation
|
||||
// Copyright (c) 2000 - 2003, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2000 by the Intel Numerics Group, Intel Corporation
|
||||
@ -52,6 +52,7 @@
|
||||
// 05/20/02 Cleaned up namespace and sf0 syntax
|
||||
// 09/07/02 Force inexact flag
|
||||
// 11/15/02 Split underflow path into zero/nonzero; eliminated fma in main path
|
||||
// 05/30/03 Set inexact flag on unmasked overflow/underflow
|
||||
|
||||
// API
|
||||
//==============================================================
|
||||
@ -602,7 +603,7 @@ EXP_CERTAIN_OVERFLOW:
|
||||
}
|
||||
{ .mfb
|
||||
mov GR_Parameter_TAG = 14
|
||||
fma.d.s0 FR_RESULT = fTmp, fTmp, f0 // Set I,O and +INF result
|
||||
fma.d.s0 FR_RESULT = fTmp, fTmp, fTmp // Set I,O and +INF result
|
||||
br.cond.sptk __libm_error_region
|
||||
}
|
||||
;;
|
||||
@ -685,6 +686,13 @@ EXP_CERTAIN_UNDERFLOW:
|
||||
}
|
||||
;;
|
||||
|
||||
{ .mfi
|
||||
nop.m 0
|
||||
fmerge.se fTmp = fTmp, fLn2_by_128_lo // Small with signif lsb 1
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
{ .mfb
|
||||
nop.m 0
|
||||
fma.d.s0 f8 = fTmp, fTmp, f0 // Set I,U, tiny (+0.0) result
|
||||
@ -730,6 +738,7 @@ EXP_UNDERFLOW_ZERO:
|
||||
|
||||
GLOBAL_IEEE754_END(exp)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -1,7 +1,7 @@
|
||||
.file "exp10.s"
|
||||
|
||||
|
||||
// Copyright (c) 2000 - 2003, Intel Corporation
|
||||
// Copyright (c) 2000 - 2004, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2000 by the Intel Numerics Group, Intel Corporation
|
||||
@ -35,7 +35,7 @@
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http: //www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
// http://www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
//
|
||||
// History
|
||||
//==============================================================
|
||||
@ -43,6 +43,7 @@
|
||||
// 05/20/02 Cleaned up namespace and sf0 syntax
|
||||
// 09/06/02 Improved performance; no inexact flags on exact cases
|
||||
// 01/29/03 Added missing } to bundle templates
|
||||
// 12/16/04 Call error handling on underflow.
|
||||
//
|
||||
// API
|
||||
//==============================================================
|
||||
@ -81,8 +82,8 @@
|
||||
// Registers used
|
||||
//==============================================================
|
||||
// r2-r3, r14-r40
|
||||
// f6-f15, f32-f51
|
||||
// p6-p9, p12
|
||||
// f6-f15, f32-f52
|
||||
// p6-p12
|
||||
//
|
||||
|
||||
|
||||
@ -104,6 +105,7 @@ GR_EXPMAX = r24
|
||||
GR_BIAS53 = r25
|
||||
|
||||
GR_ROUNDVAL = r26
|
||||
GR_SNORM_LIMIT = r26
|
||||
GR_MASK = r27
|
||||
GR_KF0 = r28
|
||||
GR_MASK_low = r29
|
||||
@ -161,6 +163,7 @@ FR_E = f49
|
||||
FR_exact_limit = f50
|
||||
|
||||
FR_int_x = f51
|
||||
FR_SNORM_LIMIT = f52
|
||||
|
||||
|
||||
// Data tables
|
||||
@ -256,8 +259,12 @@ GLOBAL_IEEE754_ENTRY(exp10)
|
||||
}
|
||||
;;
|
||||
|
||||
{.mib
|
||||
{.mlx
|
||||
ldfe FR_LOG2_10= [ GR_COEFF_START ], 16 // load log2(10)*2^(10-63)
|
||||
movl GR_SNORM_LIMIT= 0xc0733a7146f72a41 // Smallest normal threshold
|
||||
}
|
||||
{.mib
|
||||
nop.m 0
|
||||
nop.i 0
|
||||
(p12) br.cond.spnt SPECIAL_exp10 // Branch if nan, inf, zero
|
||||
}
|
||||
@ -284,7 +291,7 @@ GLOBAL_IEEE754_ENTRY(exp10)
|
||||
;;
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
setf.d FR_SNORM_LIMIT= GR_SNORM_LIMIT // Set smallest normal limit
|
||||
fma.s1 FR_L2_10_high= FR_LOG2_10, FR_2P53, f0 // FR_LOG2_10= log2(10)_hi
|
||||
nop.i 0
|
||||
}
|
||||
@ -388,6 +395,13 @@ GLOBAL_IEEE754_ENTRY(exp10)
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
fcmp.ge.s1 p11,p0= f8, FR_SNORM_LIMIT // Test x for normal range
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
fma.s1 FR_E= FR_E0, FR_COEFF1, f0 // E= C_1*e
|
||||
@ -431,10 +445,17 @@ GLOBAL_IEEE754_ENTRY(exp10)
|
||||
{.mfb
|
||||
nop.m 0
|
||||
(p9) fma.d.s1 f8= FR_P, FR_T, FR_T // result= T+T*P, exact use s1
|
||||
br.ret.sptk b0 // return
|
||||
(p11) br.ret.sptk b0 // return, if result normal
|
||||
}
|
||||
;;
|
||||
|
||||
// Here if result in denormal range (and not zero)
|
||||
{.mib
|
||||
nop.m 0
|
||||
mov GR_Parameter_TAG= 265
|
||||
br.cond.sptk __libm_error_region // Branch to error handling
|
||||
}
|
||||
;;
|
||||
|
||||
SPECIAL_exp10:
|
||||
{.mfi
|
||||
@ -487,53 +508,35 @@ SPECIAL_exp10:
|
||||
|
||||
OUT_RANGE_exp10:
|
||||
|
||||
// underflow: p6= 1
|
||||
// overflow: p8= 1
|
||||
|
||||
{.mii
|
||||
.pred.rel "mutex",p6,p8
|
||||
{.mmi
|
||||
(p8) mov GR_EXPMAX= 0x1fffe
|
||||
nop.i 0
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
|
||||
{.mmb
|
||||
(p8) mov GR_Parameter_TAG= 166
|
||||
(p8) setf.exp FR_R= GR_EXPMAX
|
||||
nop.b 999
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfi
|
||||
nop.m 999
|
||||
(p8) fma.d.s0 f8= FR_R, FR_R, f0 // Create overflow
|
||||
nop.i 999
|
||||
}
|
||||
// underflow: p6= 1
|
||||
{.mii
|
||||
nop.m 0
|
||||
(p6) mov GR_EXPMAX= 1
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
{.mmb
|
||||
nop.m 0
|
||||
(p6) setf.exp FR_R= GR_EXPMAX
|
||||
nop.b 999
|
||||
{.mii
|
||||
setf.exp FR_R= GR_EXPMAX
|
||||
(p8) mov GR_Parameter_TAG= 166
|
||||
(p6) mov GR_Parameter_TAG= 265
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfb
|
||||
nop.m 999
|
||||
(p6) fma.d.s0 f8= FR_R, FR_R, f0 // Create underflow
|
||||
(p6) br.ret.sptk b0 // will not call libm_error for underflow
|
||||
nop.m 0
|
||||
fma.d.s0 f8= FR_R, FR_R, f0 // Create overflow/underflow
|
||||
br.cond.sptk __libm_error_region // Branch to error handling
|
||||
}
|
||||
;;
|
||||
|
||||
GLOBAL_IEEE754_END(exp10)
|
||||
weak_alias (exp10, pow10)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
|
||||
.prologue
|
||||
|
@ -1,7 +1,7 @@
|
||||
.file "exp10f.s"
|
||||
|
||||
|
||||
// Copyright (c) 2000 - 2003, Intel Corporation
|
||||
// Copyright (c) 2000 - 2004, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2000 by the Intel Numerics Group, Intel Corporation
|
||||
@ -35,7 +35,7 @@
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http: //www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
// http://www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
//
|
||||
// History
|
||||
//==============================================================
|
||||
@ -43,6 +43,7 @@
|
||||
// 05/20/02 Cleaned up namespace and sf0 syntax
|
||||
// 09/06/02 Improved performance and accuracy; no inexact flags on exact cases
|
||||
// 01/29/03 Added missing } to bundle templates
|
||||
// 12/16/04 Call error handling on underflow.
|
||||
//
|
||||
// API
|
||||
//==============================================================
|
||||
@ -80,8 +81,8 @@
|
||||
// Registers used
|
||||
//==============================================================
|
||||
// r2-r3, r14-r40
|
||||
// f6-f15, f32-f51
|
||||
// p6-p9, p12
|
||||
// f6-f15, f32-f52
|
||||
// p6-p12
|
||||
//
|
||||
|
||||
|
||||
@ -102,6 +103,7 @@ GR_Fh_ADDR = r23
|
||||
GR_EXPMAX = r24
|
||||
|
||||
GR_ROUNDVAL = r26
|
||||
GR_SNORM_LIMIT = r26
|
||||
GR_MASK = r27
|
||||
GR_KF0 = r28
|
||||
GR_MASK_low = r29
|
||||
@ -153,6 +155,7 @@ FR_E = f49
|
||||
FR_exact_limit = f50
|
||||
|
||||
FR_int_x = f51
|
||||
FR_SNORM_LIMIT = f52
|
||||
|
||||
|
||||
// Data tables
|
||||
@ -246,8 +249,12 @@ GLOBAL_IEEE754_ENTRY(exp10f)
|
||||
}
|
||||
;;
|
||||
|
||||
{.mib
|
||||
{.mlx
|
||||
ldfe FR_LOG2_10= [ GR_COEFF_START ], 16 // load log2(10)*2^(10-63)
|
||||
movl GR_SNORM_LIMIT= 0xc217b818 // Smallest normal threshold
|
||||
}
|
||||
{.mib
|
||||
nop.m 0
|
||||
nop.i 0
|
||||
(p12) br.cond.spnt SPECIAL_exp10 // Branch if nan, inf, zero
|
||||
}
|
||||
@ -261,7 +268,7 @@ GLOBAL_IEEE754_ENTRY(exp10f)
|
||||
;;
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
setf.s FR_SNORM_LIMIT= GR_SNORM_LIMIT // Set smallest normal limit
|
||||
(p8) fcvt.fx.s1 FR_int_x = f8 // Convert x to integer
|
||||
nop.i 0
|
||||
}
|
||||
@ -335,7 +342,7 @@ GLOBAL_IEEE754_ENTRY(exp10f)
|
||||
|
||||
{.mfb
|
||||
ldf8 FR_T_high= [ GR_Fh_ADDR ] // load T_high= 2^{f_high}
|
||||
nop.f 0
|
||||
fcmp.ge.s1 p11, p0= f8, FR_SNORM_LIMIT // Test x for normal range
|
||||
(p12) br.cond.spnt OUT_RANGE_exp10
|
||||
}
|
||||
;;
|
||||
@ -390,10 +397,17 @@ GLOBAL_IEEE754_ENTRY(exp10f)
|
||||
{.mfb
|
||||
nop.m 0
|
||||
(p9) fma.s.s1 f8= FR_P, FR_T, FR_T // result= T+T*P, exact use s1
|
||||
br.ret.sptk b0 // return
|
||||
(p11) br.ret.sptk b0 // return, if result normal
|
||||
}
|
||||
;;
|
||||
|
||||
// Here if result in denormal range (and not zero)
|
||||
{.mib
|
||||
nop.m 0
|
||||
mov GR_Parameter_TAG= 266
|
||||
br.cond.sptk __libm_error_region // Branch to error handling
|
||||
}
|
||||
;;
|
||||
|
||||
SPECIAL_exp10:
|
||||
{.mfi
|
||||
@ -446,53 +460,35 @@ SPECIAL_exp10:
|
||||
|
||||
OUT_RANGE_exp10:
|
||||
|
||||
// underflow: p6= 1
|
||||
// overflow: p8= 1
|
||||
|
||||
{.mii
|
||||
.pred.rel "mutex",p6,p8
|
||||
{.mmi
|
||||
(p8) mov GR_EXPMAX= 0x1fffe
|
||||
nop.i 0
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
|
||||
{.mmb
|
||||
(p8) mov GR_Parameter_TAG= 167
|
||||
(p8) setf.exp FR_R= GR_EXPMAX
|
||||
nop.b 999
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfi
|
||||
nop.m 999
|
||||
(p8) fma.s.s0 f8= FR_R, FR_R, f0 // Create overflow
|
||||
nop.i 999
|
||||
}
|
||||
// underflow: p6= 1
|
||||
{.mii
|
||||
nop.m 0
|
||||
(p6) mov GR_EXPMAX= 1
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
{.mmb
|
||||
nop.m 0
|
||||
(p6) setf.exp FR_R= GR_EXPMAX
|
||||
nop.b 999
|
||||
{.mii
|
||||
setf.exp FR_R= GR_EXPMAX
|
||||
(p8) mov GR_Parameter_TAG= 167
|
||||
(p6) mov GR_Parameter_TAG= 266
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfb
|
||||
nop.m 999
|
||||
(p6) fma.s.s0 f8= FR_R, FR_R, f0 // Create underflow
|
||||
(p6) br.ret.sptk b0 // will not call libm_error for underflow
|
||||
nop.m 0
|
||||
fma.s.s0 f8= FR_R, FR_R, f0 // Create overflow/underflow
|
||||
br.cond.sptk __libm_error_region // Branch to error handling
|
||||
}
|
||||
;;
|
||||
|
||||
GLOBAL_IEEE754_END(exp10f)
|
||||
weak_alias (exp10f, pow10f)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
|
||||
.prologue
|
||||
|
@ -1,7 +1,7 @@
|
||||
.file "exp10l.s"
|
||||
|
||||
|
||||
// Copyright (c) 2000 - 2003, Intel Corporation
|
||||
// Copyright (c) 2000 - 2004, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2000 by the Intel Numerics Group, Intel Corporation
|
||||
@ -44,6 +44,7 @@
|
||||
// 02/06/03 Reordered header: .section, .global, .proc, .align
|
||||
// 05/08/03 Reformatted assembly source; corrected overflow result for round to
|
||||
// -inf and round to zero; exact results now don't set inexact flag
|
||||
// 12/16/04 Call error handling on underflow.
|
||||
//
|
||||
// API
|
||||
//==============================================================
|
||||
@ -79,9 +80,9 @@
|
||||
|
||||
// Registers used
|
||||
//==============================================================
|
||||
// f6-f15, f32-f62
|
||||
// f6-f15, f32-f63
|
||||
// r14-r30, r32-r40
|
||||
// p6-p8, p12-p14
|
||||
// p6-p8, p11-p14
|
||||
//
|
||||
|
||||
|
||||
@ -129,6 +130,7 @@
|
||||
FR_4 = f60
|
||||
FR_28 = f61
|
||||
FR_32 = f62
|
||||
FR_SNORM_LIMIT = f63
|
||||
|
||||
|
||||
GR_ADDR0 = r14
|
||||
@ -178,6 +180,7 @@ LOCAL_OBJECT_START(poly_coeffs)
|
||||
data8 0x3f55d87fe78a6731 // C_5
|
||||
data8 0x3f2430912f86c787 // C_6
|
||||
data8 0x9257edfe9b5fb698, 0x00003fbf // log2(10)_low (bits 64...127)
|
||||
data8 0x9a1bc98027a81918, 0x0000c00b // Smallest normal threshold
|
||||
LOCAL_OBJECT_END(poly_coeffs)
|
||||
|
||||
|
||||
@ -435,7 +438,7 @@ GLOBAL_IEEE754_ENTRY(exp10l)
|
||||
|
||||
{.mmf
|
||||
// GR_D_ADDR = pointer to D table
|
||||
add GR_D_ADDR = 2048-64+96+16, GR_ADDR0
|
||||
add GR_D_ADDR = 2048-64+96+32, GR_ADDR0
|
||||
// load C_3, C_4
|
||||
ldfpd FR_COEFF3, FR_COEFF4 = [ GR_ADDR0 ], 16
|
||||
// y = x*log2(10)*2^8
|
||||
@ -471,7 +474,8 @@ GLOBAL_IEEE754_ENTRY(exp10l)
|
||||
}
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
// load smallest normal limit
|
||||
ldfe FR_SNORM_LIMIT = [ GR_ADDR0 ], 16
|
||||
// x>overflow threshold ?
|
||||
fcmp.gt.s1 p12, p7 = f8, FR_OF_TEST
|
||||
nop.i 0 ;;
|
||||
@ -596,6 +600,13 @@ GLOBAL_IEEE754_ENTRY(exp10l)
|
||||
nop.i 0 ;;
|
||||
}
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
// test if x >= smallest normal limit
|
||||
fcmp.ge.s1 p11, p0 = f8, FR_SNORM_LIMIT
|
||||
nop.i 0 ;;
|
||||
}
|
||||
|
||||
{.mfi
|
||||
nop.m 0
|
||||
// P36 = P34+r2*P56
|
||||
@ -646,9 +657,16 @@ GLOBAL_IEEE754_ENTRY(exp10l)
|
||||
// result = T+T*P
|
||||
(p14) fma.s0 f8 = FR_COEFF3, FR_UF_TEST, FR_UF_TEST
|
||||
// return
|
||||
br.ret.sptk b0 ;;
|
||||
(p11) br.ret.sptk b0 ;; // return, if result normal
|
||||
}
|
||||
|
||||
// Here if result in denormal range (and not zero)
|
||||
{.mib
|
||||
nop.m 0
|
||||
mov GR_Parameter_TAG= 264
|
||||
br.cond.sptk __libm_error_region // Branch to error handling
|
||||
}
|
||||
;;
|
||||
|
||||
SPECIAL_EXP10:
|
||||
|
||||
@ -703,47 +721,35 @@ SPECIAL_EXP10:
|
||||
|
||||
OUT_RANGE_EXP10:
|
||||
|
||||
{.mii
|
||||
// overflow: p8 = 1
|
||||
// underflow: p6 = 1
|
||||
// overflow: p8 = 1
|
||||
|
||||
.pred.rel "mutex",p6,p8
|
||||
{.mmi
|
||||
(p8) mov GR_CONST1 = 0x1fffe
|
||||
nop.i 0
|
||||
nop.i 0 ;;
|
||||
}
|
||||
|
||||
{.mmb
|
||||
(p8) mov GR_Parameter_TAG = 165
|
||||
(p8) setf.exp FR_KF0 = GR_CONST1
|
||||
nop.b 999 ;;
|
||||
}
|
||||
|
||||
{.mfi
|
||||
nop.m 999
|
||||
(p8) fma.s0 f8 = FR_KF0, FR_KF0, f0
|
||||
nop.i 999
|
||||
}
|
||||
{.mii
|
||||
nop.m 0
|
||||
// underflow: p6 = 1
|
||||
(p6) mov GR_CONST1 = 1
|
||||
nop.i 0 ;;
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
{.mmb
|
||||
nop.m 0
|
||||
(p6) setf.exp FR_KF0 = GR_CONST1
|
||||
nop.b 999 ;;
|
||||
{.mii
|
||||
setf.exp FR_KF0 = GR_CONST1
|
||||
(p8) mov GR_Parameter_TAG = 165
|
||||
(p6) mov GR_Parameter_TAG = 264
|
||||
}
|
||||
;;
|
||||
|
||||
{.mfb
|
||||
nop.m 999
|
||||
(p6) fma.s0 f8 = FR_KF0, FR_KF0, f0
|
||||
// will not call libm_error for underflow
|
||||
(p6) br.ret.sptk b0 ;;
|
||||
fma.s0 f8 = FR_KF0, FR_KF0, f0 // Create overflow/underflow
|
||||
br.cond.sptk __libm_error_region // Branch to error handling
|
||||
}
|
||||
;;
|
||||
|
||||
GLOBAL_IEEE754_END(exp10l)
|
||||
weak_alias (exp10l, pow10l)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{.mfi
|
||||
|
@ -35,7 +35,7 @@
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http: //www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
// http://www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
//
|
||||
// History
|
||||
//==============================================================
|
||||
@ -495,6 +495,7 @@ OUT_RANGE_exp2:
|
||||
|
||||
GLOBAL_LIBM_END(exp2)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
|
||||
.prologue
|
||||
|
@ -35,7 +35,7 @@
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http: //www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
// http://www.intel.com/software/products/opensource/libraries/num.htm.
|
||||
//
|
||||
// History
|
||||
//==============================================================
|
||||
@ -470,6 +470,7 @@ OUT_RANGE_exp2:
|
||||
|
||||
GLOBAL_LIBM_END(exp2f)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
|
||||
.prologue
|
||||
|
@ -747,6 +747,7 @@ OUT_RANGE_exp2l:
|
||||
|
||||
GLOBAL_LIBM_END(exp2l)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{.mfi
|
||||
|
@ -1,7 +1,7 @@
|
||||
.file "expf.s"
|
||||
|
||||
|
||||
// Copyright (c) 2000 - 2002, Intel Corporation
|
||||
// Copyright (c) 2000 - 2003, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2000 by the Intel Numerics Group, Intel Corporation
|
||||
@ -52,6 +52,7 @@
|
||||
// 09/26/02 support of higher precision inputs added, underflow threshold
|
||||
// corrected
|
||||
// 11/15/02 Improved performance on Itanium 2, added possible over/under paths
|
||||
// 05/30/03 Set inexact flag on unmasked overflow/underflow
|
||||
//
|
||||
//
|
||||
// API
|
||||
@ -521,7 +522,7 @@ EXP_CERTAIN_OVERFLOW:
|
||||
}
|
||||
{ .mfb
|
||||
mov GR_Parameter_TAG = 16
|
||||
fma.s.s0 FR_RESULT = fTmp, fTmp, f0 // Set I,O and +INF result
|
||||
fma.s.s0 FR_RESULT = fTmp, fTmp, fTmp // Set I,O and +INF result
|
||||
br.cond.sptk __libm_error_region
|
||||
}
|
||||
;;
|
||||
@ -604,6 +605,13 @@ EXP_CERTAIN_UNDERFLOW:
|
||||
}
|
||||
;;
|
||||
|
||||
{ .mfi
|
||||
nop.m 0
|
||||
fmerge.se fTmp = fTmp, f64DivLn2 // Small with non-trial signif
|
||||
nop.i 0
|
||||
}
|
||||
;;
|
||||
|
||||
{ .mfb
|
||||
nop.m 0
|
||||
fma.s.s0 f8 = fTmp, fTmp, f0 // Set I,U, tiny (+0.0) result
|
||||
@ -649,6 +657,7 @@ EXP_UNDERFLOW_ZERO:
|
||||
|
||||
GLOBAL_IEEE754_END(expf)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -499,6 +499,7 @@ FMOD_Y_ZERO:
|
||||
}
|
||||
|
||||
GLOBAL_IEEE754_END(fmod)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -514,6 +514,7 @@ EXP_ERROR_RETURN:
|
||||
}
|
||||
|
||||
GLOBAL_IEEE754_END(fmodf)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -106,6 +106,7 @@ FR_RESULT = f8
|
||||
|
||||
LOCAL_LIBM_ENTRY(cabs)
|
||||
LOCAL_LIBM_END(cabs)
|
||||
|
||||
GLOBAL_IEEE754_ENTRY(hypot)
|
||||
|
||||
{.mfi
|
||||
@ -384,6 +385,7 @@ GLOBAL_IEEE754_ENTRY(hypot)
|
||||
(p9) br.ret.sptk b0;;
|
||||
}
|
||||
GLOBAL_IEEE754_END(hypot)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -106,6 +106,7 @@ FR_RESULT = f8
|
||||
|
||||
LOCAL_LIBM_ENTRY(cabsf)
|
||||
LOCAL_LIBM_END(cabsf)
|
||||
|
||||
GLOBAL_IEEE754_ENTRY(hypotf)
|
||||
{.mfi
|
||||
alloc r32= ar.pfs,0,4,4,0
|
||||
@ -337,6 +338,7 @@ GLOBAL_IEEE754_ENTRY(hypotf)
|
||||
(p9) br.ret.sptk b0;;
|
||||
}
|
||||
GLOBAL_IEEE754_END(hypotf)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mii
|
||||
|
@ -105,6 +105,7 @@ FR_RESULT = f8
|
||||
|
||||
LOCAL_LIBM_ENTRY(cabsl)
|
||||
LOCAL_LIBM_END(cabsl)
|
||||
|
||||
GLOBAL_IEEE754_ENTRY(hypotl)
|
||||
{.mfi
|
||||
alloc r32= ar.pfs,0,4,4,0
|
||||
@ -421,6 +422,7 @@ GLOBAL_IEEE754_ENTRY(hypotl)
|
||||
(p9) br.ret.sptk b0;;
|
||||
}
|
||||
GLOBAL_IEEE754_END(hypotl)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* file: lgamma_r.c */
|
||||
|
||||
|
||||
// Copyright (c) 2002 Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -20,7 +21,6 @@
|
||||
// products derived from this software without specific prior written
|
||||
// permission.
|
||||
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* file: lgammaf_r.c */
|
||||
|
||||
|
||||
// Copyright (c) 2002 Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -20,7 +21,6 @@
|
||||
// products derived from this software without specific prior written
|
||||
// permission.
|
||||
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* file: lgammal_r.c */
|
||||
|
||||
|
||||
// Copyright (c) 2002 Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -20,7 +21,6 @@
|
||||
// products derived from this software without specific prior written
|
||||
// permission.
|
||||
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
@ -1386,6 +1386,7 @@ GLOBAL_IEEE754_ENTRY(log10)
|
||||
};;
|
||||
GLOBAL_IEEE754_END(log10)
|
||||
|
||||
|
||||
GLOBAL_IEEE754_ENTRY(log)
|
||||
{ .mfi
|
||||
getf.exp GR_Exp = f8 // if x is unorm then must recompute
|
||||
@ -1667,6 +1668,7 @@ log_libm_err:
|
||||
};;
|
||||
GLOBAL_IEEE754_END(log)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -655,6 +655,7 @@ SPECIAL_LOG2:
|
||||
|
||||
GLOBAL_LIBM_END(log2)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -493,6 +493,7 @@ SPECIAL_log2f:
|
||||
|
||||
GLOBAL_LIBM_END(log2f)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -761,6 +761,7 @@ LOG2_PSEUDO_ZERO:
|
||||
|
||||
GLOBAL_IEEE754_END(log2l)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -841,6 +841,7 @@ GLOBAL_IEEE754_ENTRY(log10f)
|
||||
br.cond.sptk logf_log10f_common
|
||||
};;
|
||||
GLOBAL_IEEE754_END(log10f)
|
||||
|
||||
GLOBAL_IEEE754_ENTRY(logf)
|
||||
{ .mfi
|
||||
getf.exp GR_Exp = f8 // if x is unorm then must recompute
|
||||
@ -1087,6 +1088,7 @@ logf_libm_err:
|
||||
};;
|
||||
GLOBAL_IEEE754_END(logf)
|
||||
|
||||
|
||||
// Stack operations when calling error support.
|
||||
// (1) (2) (3) (call) (4)
|
||||
// sp -> + psp -> + psp -> + sp -> +
|
||||
|
@ -634,6 +634,7 @@ GLOBAL_IEEE754_ENTRY(logl)
|
||||
|
||||
GLOBAL_IEEE754_END(logl)
|
||||
|
||||
|
||||
GLOBAL_IEEE754_ENTRY(log10l)
|
||||
{ .mfi
|
||||
alloc r32 = ar.pfs,0,21,4,0
|
||||
@ -1144,6 +1145,7 @@ LOGL_64_negative:
|
||||
|
||||
|
||||
GLOBAL_IEEE754_END(log10l)
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
@ -2234,6 +2234,7 @@ POW_OVER_UNDER_ERROR:
|
||||
|
||||
GLOBAL_LIBM_END(pow)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
|
||||
.prologue
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -60,6 +60,7 @@
|
||||
// 02/10/03 Reordered header: .section, .global, .proc, .align;
|
||||
// used data8 for long double table values
|
||||
// 04/17/03 Added missing mutex directive
|
||||
// 10/13/03 Corrected .endp names to match .proc names
|
||||
//
|
||||
//*********************************************************************
|
||||
//
|
||||
@ -2755,6 +2756,7 @@ POWL_64_SQRT:
|
||||
|
||||
GLOBAL_LIBM_END(powl)
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
@ -2803,6 +2805,6 @@ LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
br.ret.sptk b0 // Return
|
||||
};;
|
||||
|
||||
.endp
|
||||
LOCAL_LIBM_END(__libm_error_region#)
|
||||
.type __libm_error_support#,@function
|
||||
.global __libm_error_support#
|
||||
|
@ -531,6 +531,7 @@ EXP_ERROR_RETURN:
|
||||
GLOBAL_IEEE754_END(remainder)
|
||||
|
||||
|
||||
|
||||
LOCAL_LIBM_ENTRY(__libm_error_region)
|
||||
.prologue
|
||||
{ .mfi
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user