From 274e6d871acc08da2eb7a30bb6c4604885475465 Mon Sep 17 00:00:00 2001 From: joseph Date: Mon, 6 Sep 2010 15:29:36 +0000 Subject: Merge changes between r11304 and r11460 from /fsf/trunk. git-svn-id: svn://svn.eglibc.org/trunk@11461 7b3dc134-2b1b-0410-93df-9e9f96275f8d --- libc/ChangeLog | 173 +++++++++ libc/LICENSES | 52 +-- libc/NEWS | 4 +- libc/bits/sched.h | 15 + libc/config-name.in | 9 - libc/configure | 391 ++++++++------------- libc/configure.in | 271 +++++--------- libc/debug/vdprintf_chk.c | 10 +- libc/iconvdata/gconv-modules | 5 - libc/include/rpc/pmap_clnt.h | 5 + libc/libio/iofdopen.c | 7 +- libc/libio/iofopncook.c | 7 +- libc/libio/iovdprintf.c | 8 +- libc/libio/oldiofdopen.c | 5 +- libc/manual/Makefile | 5 +- libc/nis/nis_findserv.c | 45 +-- libc/nis/rpcsvc/nis.h | 55 +-- libc/nis/rpcsvc/nis.x | 113 +++--- libc/nis/rpcsvc/nis_callback.h | 49 +-- libc/nis/rpcsvc/nis_callback.x | 56 ++- libc/nis/rpcsvc/nis_object.x | 142 +++++--- libc/nis/rpcsvc/nis_tags.h | 55 ++- libc/nis/rpcsvc/yp.h | 48 +-- libc/nis/rpcsvc/yp.x | 60 ++-- libc/nis/rpcsvc/ypupd.h | 52 ++- libc/nis/yp_xdr.c | 48 +-- libc/nis/ypupdate_xdr.c | 52 ++- libc/nptl/ChangeLog | 5 + libc/nptl/sysdeps/pthread/allocalim.h | 4 +- libc/posix/Makefile | 8 + libc/resolv/res_init.c | 52 ++- libc/scripts/config-uname.sh | 50 +++ libc/stdlib/strtod_l.c | 4 +- libc/sunrpc/Versions | 2 +- libc/sunrpc/pm_getport.c | 32 +- libc/sunrpc/rpc_parse.h | 3 +- libc/sysdeps/i386/i686/multiarch/Makefile | 4 +- libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S | 127 +++++++ libc/sysdeps/i386/i686/multiarch/strlen-sse2.S | 347 ++++++++++++++++++ libc/sysdeps/i386/i686/multiarch/strlen.S | 83 +---- libc/sysdeps/i386/i686/multiarch/varshift.c | 1 + libc/sysdeps/i386/i686/multiarch/varshift.h | 1 + libc/sysdeps/powerpc/powerpc64/dl-machine.h | 8 +- .../sysv/linux/powerpc/powerpc32/syscalls.list | 1 + libc/sysdeps/unix/sysv/linux/sparc/sys/epoll.h | 9 +- libc/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h | 4 +- libc/sysdeps/x86_64/add_n.S | 99 ++++-- libc/sysdeps/x86_64/addmul_1.S | 115 ++++-- libc/sysdeps/x86_64/lshift.S | 127 +++++-- libc/sysdeps/x86_64/mul_1.S | 119 ++++++- libc/sysdeps/x86_64/multiarch/Makefile | 5 +- libc/sysdeps/x86_64/multiarch/init-arch.c | 6 + libc/sysdeps/x86_64/multiarch/init-arch.h | 6 + libc/sysdeps/x86_64/multiarch/memmove.c | 29 +- libc/sysdeps/x86_64/multiarch/memmove_chk.c | 28 +- libc/sysdeps/x86_64/multiarch/strcspn-c.c | 156 +------- libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S | 309 ++++++++++++++++ libc/sysdeps/x86_64/multiarch/strlen-sse4.S | 85 +++++ libc/sysdeps/x86_64/multiarch/strlen.S | 74 +--- libc/sysdeps/x86_64/multiarch/strspn-c.c | 154 +------- libc/sysdeps/x86_64/multiarch/strstr.c | 62 +--- libc/sysdeps/x86_64/multiarch/varshift.c | 26 ++ libc/sysdeps/x86_64/multiarch/varshift.h | 31 ++ libc/sysdeps/x86_64/rshift.S | 129 +++++-- libc/sysdeps/x86_64/strlen.S | 93 +++-- libc/sysdeps/x86_64/sub_n.S | 28 +- libc/sysdeps/x86_64/submul_1.S | 32 +- 67 files changed, 2567 insertions(+), 1633 deletions(-) delete mode 100644 libc/config-name.in create mode 100755 libc/scripts/config-uname.sh create mode 100644 libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S create mode 100644 libc/sysdeps/i386/i686/multiarch/strlen-sse2.S create mode 100644 libc/sysdeps/i386/i686/multiarch/varshift.c create mode 100644 libc/sysdeps/i386/i686/multiarch/varshift.h create mode 100644 libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S create mode 100644 libc/sysdeps/x86_64/multiarch/strlen-sse4.S create mode 100644 libc/sysdeps/x86_64/multiarch/varshift.c create mode 100644 libc/sysdeps/x86_64/multiarch/varshift.h (limited to 'libc') diff --git a/libc/ChangeLog b/libc/ChangeLog index 1a9f17a61..608be4e12 100644 --- a/libc/ChangeLog +++ b/libc/ChangeLog @@ -1,3 +1,176 @@ +2010-09-06 Andreas Schwab + + * manual/Makefile: Don't mix pattern rules with normal rules. + +2010-09-05 Andreas Schwab + + * debug/vdprintf_chk.c (__vdprintf_chk): Remove undefined + operation. + * libio/iofdopen.c (_IO_new_fdopen): Likewise. + * libio/iofopncook.c (_IO_cookie_init): Likewise. + * libio/iovdprintf.c (_IO_vdprintf): Likewise. + * libio/oldiofdopen.c (_IO_old_fdopen): Likewise. + * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): + Likewise. + +2010-09-04 Ulrich Drepper + + [BZ #11979] + * iconvdata/gconv-modules: Remove EBCDIC-CP-AR2 alias from + IBM-930, IBM-933, IBM-935, IBM-937, and IBM-939. + +2010-09-02 Ulrich Drepper + + * sysdeps/x86_64/add_n.S: Update from GMP 5.0.1. + * sysdeps/x86_64/addmul_1.S: Likewise. + * sysdeps/x86_64/lshift.S: Likewise. + * sysdeps/x86_64/mul_1.S: Likewise. + * sysdeps/x86_64/rshift.S: Likewise. + * sysdeps/x86_64/sub_n.S: Likewise. + * sysdeps/x86_64/submul_1.S: Likewise. + +2010-09-01 Samuel Thibault + + This aligns bits/sched.h onto sysdeps/unix/sysv/linux/bits/sched.h: + Define __sched_param instead of SCHED_* and sched_param when + is included with __need_schedparam defined. + * bits/sched.h [__need_schedparam] + (SCHED_OTHER, SCHED_FIFO, SCHED_RR, sched_param): Do not define. + [!__defined_schedparam && (__need_schedparam || _SCHED_H)] + (__defined_schedparam): Define to 1. + (__sched_param): New structure, identical to sched_param. + (__need_schedparam): Undefine. + +2010-08-31 Mike Frysinger + + * sysdeps/unix/sysv/linux/sparc/sys/epoll.h (epoll_create2): Delete. + (epoll_create1): Declare. + + * sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Fix typo. + +2010-08-31 Andreas Schwab + + [BZ #7066] + * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix array overflow when + shifting retval into place. + +2010-09-01 Ulrich Drepper + + * nis/rpcsvc/nis.h: Update copyright notice. + * nis/rpcsvc/nis.x: Likewise. + * nis/rpcsvc/nis_callback.h: Likewise. + * nis/rpcsvc/nis_callback.x: Likewise. + * nis/rpcsvc/nis_object.x: Likewise. + * nis/rpcsvc/nis_tags.h: Likewise. + * nis/rpcsvc/yp.h: Likewise. + * nis/rpcsvc/yp.x: Likewise. + * nis/rpcsvc/ypupd.h: Likewise. + * nis/yp_xdr.c: Likewise. + * nis/ypupdate_xdr.c: Likewise. + + * sunrpc/pm_getport.c (__libc_rpc_getport): New function. This is + mainly the body of pmap_getport. Add parameters to specify timeouts. + (pmap_getport): Use __libc_rpc_getport. + * sunrpc/Versions: Export __libc_rpc_getport with GLIBC_PRIVATE. + * include/rpc/pmap_clnt.h: Declare __libc_rpc_getport. + * nis/nis_findserv.c: Remove pmap_getport copy. Use __libc_rpc_getport. + +2010-08-31 Andreas Schwab + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Add + fanotify_mark. + +2010-08-27 Roland McGrath + + * sysdeps/i386/i686/multiarch/Makefile + (CFLAGS-varshift.c): New variable. + +2010-08-27 Ulrich Drepper + + * sysdeps/i386/i686/multiarch/varshift.S: File removed. + * sysdeps/i386/i686/multiarch/varshift.c: New file. + + * sysdeps/x86_64/multiarch/strlen-no-bsf.S: Move to .text.slow section. + + * sysdeps/x86_64/strlen.S: Minimal code improvement. + +2010-08-26 H.J. Lu + + * sysdeps/x86_64/strlen.S: Unroll the loop. + * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add + strlen-sse2 strlen-sse2-bsf. + * sysdeps/x86_64/multiarch/strlen.S ((strlen): Return + __strlen_no_bsf if bit_Slow_BSF is set. + (__strlen_sse42): Removed. + * sysdeps/x86_64/multiarch/strlen-no-bsf.S: New file. + * sysdeps/x86_64/multiarch/strlen-sse4.S: New file. + +2010-08-25 Roland McGrath + + * sysdeps/x86_64/multiarch/varshift.S: File removed. + * sysdeps/x86_64/multiarch/varshift.c: New file. + * sysdeps/x86_64/multiarch/Makefile (CFLAGS-varshift.c): New variable. + * sysdeps/x86_64/multiarch/varshift.h: Clean up decls, fix a cast. + * sysdeps/x86_64/multiarch/memmove.c: Move decls around. + * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise. + +2010-08-25 H.J. Lu + + * sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add + strlen-sse2 strlen-sse2-bsf. + * sysdeps/i386/i686/multiarch/strlen.S (strlen): Return + __strlen_sse2_bsf if bit_Slow_BSF is unset. + (__strlen_sse2): Removed. + * sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: New file. + * sysdeps/i386/i686/multiarch/strlen-sse2.S: New file. + * sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Set + bit_Slow_BSF for Atom. + * sysdeps/x86_64/multiarch/init-arch.h (bit_Slow_BSF): Define. + (index_Slow_BSF): Define. + (HAS_SLOW_BSF): Define. + +2010-08-25 Ulrich Drepper + + [BZ #10851] + * resolv/res_init.c (__res_vinit): When no server address at all + is given default to loopback. + +2010-08-24 Roland McGrath + + * configure.in: Remove config-name.h generation. + * configure: Regenerated. + * config-name.in: File removed. + * scripts/config-uname.sh: New file. + * posix/Makefile (uname.c): Depend on $(objdir)config-name.h. + ($(objdir)config-name.h): New target. + + * sunrpc/rpc_parse.h: Avoid nested comment. + +2010-08-24 Richard Henderson + Ulrich Drepper + H.J. Lu + + * sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add varshift. + * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Likewise. + * sysdeps/x86_64/multiarch/strcspn-c.c: Include "varshift.h". + Replace _mm_srli_si128 with __m128i_shift_right. Replace + _mm_alignr_epi8 with _mm_loadu_si128. + * sysdeps/x86_64/multiarch/strspn-c.c: Likewise. + * sysdeps/x86_64/multiarch/strstr.c: Include "varshift.h". + (__m128i_shift_right): Removed. + * sysdeps/i386/i686/multiarch/varshift.h: New file. + * sysdeps/i386/i686/multiarch/varshift.S: New file. + * sysdeps/x86_64/multiarch/varshift.h: New file. + * sysdeps/x86_64/multiarch/varshift.S: New file. + +2010-08-21 Mike Frysinger + + * configure.in: Move assembler checks to before sysdep dir checking. + +2010-08-20 Petr Baudis + + * LICENSES: Sync the sunrpc license. + 2010-08-19 Ulrich Drepper * sunrpc/auth_des.c: Update copyright notice once again. diff --git a/libc/LICENSES b/libc/LICENSES index b3b8899e5..1c99d2cde 100644 --- a/libc/LICENSES +++ b/libc/LICENSES @@ -63,30 +63,34 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. The Sun RPC support (from rpcsrc-4.0) is covered by the following license: -Copyright (C) 1984, Sun Microsystems, Inc. - -Sun RPC is a product of Sun Microsystems, Inc. and is provided for -unrestricted use provided that this legend is included on all tape media -and as a part of the software program in whole or part. Users may copy -or modify Sun RPC without charge, but are not authorized to license or -distribute it to anyone else except as part of a product or program -developed by the user. - -SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - -Sun RPC is provided with no support and without any obligation on the -part of Sun Microsystems, Inc. to assist in its use, correction, -modification or enhancement. - -SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -OR ANY PART THEREOF. - -In no event will Sun Microsystems, Inc. be liable for any lost revenue -or profits or other special, indirect and consequential damages, even if -Sun has been advised of the possibility of such damages. +Copyright (c) 2010, Oracle America, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "Oracle America, Inc." nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following CMU license covers some of the support code for Mach, diff --git a/libc/NEWS b/libc/NEWS index f3094d18a..432813bb9 100644 --- a/libc/NEWS +++ b/libc/NEWS @@ -1,4 +1,4 @@ -GNU C Library NEWS -- history of user-visible changes. 2010-8-14 +GNU C Library NEWS -- history of user-visible changes. 2010-8-25 Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc. See the end for copying conditions. @@ -9,7 +9,7 @@ Version 2.13 * The following bugs are resolved with this release: - 11640, 11701, 11840, 11856, 11883, 11903, 11904 + 7066, 10851, 11640, 11701, 11840, 11856, 11883, 11903, 11904 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark diff --git a/libc/bits/sched.h b/libc/bits/sched.h index af92dbca3..a068e5016 100644 --- a/libc/bits/sched.h +++ b/libc/bits/sched.h @@ -18,6 +18,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#ifndef __need_schedparam + #ifndef _SCHED_H # error "Never include directly; use instead." #endif @@ -34,6 +36,19 @@ struct sched_param int __sched_priority; }; +#endif /* need schedparam */ + +#if !defined __defined_schedparam \ + && (defined __need_schedparam || defined _SCHED_H) +# define __defined_schedparam 1 +/* Data structure to describe a process' schedulability. */ +struct __sched_param + { + int __sched_priority; + }; +# undef __need_schedparam +#endif + #if defined _SCHED_H && !defined __cpu_set_t_defined # define __cpu_set_t_defined diff --git a/libc/config-name.in b/libc/config-name.in deleted file mode 100644 index cdac43d86..000000000 --- a/libc/config-name.in +++ /dev/null @@ -1,9 +0,0 @@ -/* @configure_input@ -*- C -*- - - This is used only by the generic `uname' function for systems with no real - `uname' call. If this data is not correct, it does not matter much. */ - -#define UNAME_SYSNAME "@uname_sysname@" -#define UNAME_RELEASE "@uname_release@" -#define UNAME_VERSION "@uname_version@" -#define UNAME_MACHINE "@host_cpu@-@host_vendor@" diff --git a/libc/configure b/libc/configure index e290b57f1..036652be0 100755 --- a/libc/configure +++ b/libc/configure @@ -667,9 +667,6 @@ libc_cv_sysconfdir libc_cv_localedir libc_cv_slibdir old_glibc_headers -uname_version -uname_release -uname_sysname libc_cv_gcc_unwind_find_fde sizeof_long_double EGREP @@ -3873,9 +3870,6 @@ else multi_arch=default fi -if test x"$multi_arch" != xno; then - multi_arch_d=/multiarch -fi # Check whether --enable-experimental-malloc was given. if test "${enable_experimental_malloc+set}" = set; then @@ -4309,6 +4303,140 @@ _ACEOF fi +# For the multi-arch option we need support in the assembler. +{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5 +$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; } +if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat > conftest.s <&5 2>&5; +then + libc_cv_asm_gnu_indirect_function=yes +else + libc_cv_asm_gnu_indirect_function=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5 +$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; } + +{ $as_echo "$as_me:$LINENO: checking whether .text pseudo-op must be used" >&5 +$as_echo_n "checking whether .text pseudo-op must be used... " >&6; } +if test "${libc_cv_dot_text+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat > conftest.s <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + libc_cv_dot_text=.text +fi +rm -f conftest* +fi + +if test -z "$libc_cv_dot_text"; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +else + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +fi + +{ $as_echo "$as_me:$LINENO: checking for assembler global-symbol directive" >&5 +$as_echo_n "checking for assembler global-symbol directive... " >&6; } +if test "${libc_cv_asm_global_directive+set}" = set; then + $as_echo_n "(cached) " >&6 +else + libc_cv_asm_global_directive=UNKNOWN +for ac_globl in .globl .global .EXPORT; do + cat > conftest.s <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + libc_cv_asm_global_directive=${ac_globl} + fi + rm -f conftest* + test $libc_cv_asm_global_directive != UNKNOWN && break +done +fi +{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_global_directive" >&5 +$as_echo "$libc_cv_asm_global_directive" >&6; } +if test $libc_cv_asm_global_directive = UNKNOWN; then + { { $as_echo "$as_me:$LINENO: error: cannot determine asm global directive" >&5 +$as_echo "$as_me: error: cannot determine asm global directive" >&2;} + { (exit 1); exit 1; }; } +else + cat >>confdefs.h <<_ACEOF +#define ASM_GLOBAL_DIRECTIVE ${libc_cv_asm_global_directive} +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for assembler .type directive prefix" >&5 +$as_echo_n "checking for assembler .type directive prefix... " >&6; } +if test "${libc_cv_asm_type_prefix+set}" = set; then + $as_echo_n "(cached) " >&6 +else + libc_cv_asm_type_prefix=no +for ac_try_prefix in '@' '%' '#'; do + cat > conftest.s <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + libc_cv_asm_type_prefix=${ac_try_prefix} + fi + rm -f conftest* + test "x$libc_cv_asm_type_prefix" != xno && break +done +fi +{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_type_prefix" >&5 +$as_echo "$libc_cv_asm_type_prefix" >&6; } +if test "x$libc_cv_asm_type_prefix" != xno; then + cat >>confdefs.h <<_ACEOF +#define ASM_TYPE_DIRECTIVE_PREFIX ${libc_cv_asm_type_prefix} +_ACEOF + +fi + +if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then + if test x"$multi_arch" = xyes; then + { { $as_echo "$as_me:$LINENO: error: --enable-multi-arch support requires assembler and linker support" >&5 +$as_echo "$as_me: error: --enable-multi-arch support requires assembler and linker support" >&2;} + { (exit 1); exit 1; }; } + else + multi_arch=no + fi +fi +if test x"$multi_arch" != xno; then + multi_arch_d=/multiarch +fi + # Compute the list of sysdep directories for this configuration. # This can take a while to compute. sysdep_dir=$srcdir/sysdeps @@ -4425,35 +4553,14 @@ done # If the assembler supports gnu_indirect_function symbol type and the # architecture supports multi-arch, we enable multi-arch by default. -if test "$multi_arch" = default; then -{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5 -$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; } -if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <&5 2>&5; -then - libc_cv_asm_gnu_indirect_function=yes -else - libc_cv_asm_gnu_indirect_function=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5 -$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; } +case $sysnames_add_ons$sysnames in +*"$multi_arch_d"*) + ;; +*) multi_arch=no - if test "$libc_cv_asm_gnu_indirect_function" = yes; then - case $sysnames_add_ons$sysnames in - *"$multi_arch_d"*) - multi_arch=yes - ;; - esac - fi -fi -if test x"$multi_arch" = xyes; then + ;; +esac +if test x"$multi_arch" != xno; then cat >>confdefs.h <<\_ACEOF #define USE_MULTIARCH 1 _ACEOF @@ -6020,71 +6127,6 @@ if test $libc_cv_need_minus_P = yes; then asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives." fi -{ $as_echo "$as_me:$LINENO: checking whether .text pseudo-op must be used" >&5 -$as_echo_n "checking whether .text pseudo-op must be used... " >&6; } -if test "${libc_cv_dot_text+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_dot_text=.text -fi -rm -f conftest* -fi - -if test -z "$libc_cv_dot_text"; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -else - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -fi - -{ $as_echo "$as_me:$LINENO: checking for assembler global-symbol directive" >&5 -$as_echo_n "checking for assembler global-symbol directive... " >&6; } -if test "${libc_cv_asm_global_directive+set}" = set; then - $as_echo_n "(cached) " >&6 -else - libc_cv_asm_global_directive=UNKNOWN -for ac_globl in .globl .global .EXPORT; do - cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_asm_global_directive=${ac_globl} - fi - rm -f conftest* - test $libc_cv_asm_global_directive != UNKNOWN && break -done -fi -{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_global_directive" >&5 -$as_echo "$libc_cv_asm_global_directive" >&6; } -if test $libc_cv_asm_global_directive = UNKNOWN; then - { { $as_echo "$as_me:$LINENO: error: cannot determine asm global directive" >&5 -$as_echo "$as_me: error: cannot determine asm global directive" >&2;} - { (exit 1); exit 1; }; } -else - cat >>confdefs.h <<_ACEOF -#define ASM_GLOBAL_DIRECTIVE ${libc_cv_asm_global_directive} -_ACEOF - -fi - { $as_echo "$as_me:$LINENO: checking for .set assembler directive" >&5 $as_echo_n "checking for .set assembler directive... " >&6; } if test "${libc_cv_asm_set_directive+set}" = set; then @@ -6120,42 +6162,6 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for assembler .type directive prefix" >&5 -$as_echo_n "checking for assembler .type directive prefix... " >&6; } -if test "${libc_cv_asm_type_prefix+set}" = set; then - $as_echo_n "(cached) " >&6 -else - libc_cv_asm_type_prefix=no -for ac_try_prefix in '@' '%' '#'; do - cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_asm_type_prefix=${ac_try_prefix} - fi - rm -f conftest* - test "x$libc_cv_asm_type_prefix" != xno && break -done -fi -{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_type_prefix" >&5 -$as_echo "$libc_cv_asm_type_prefix" >&6; } -if test "x$libc_cv_asm_type_prefix" != xno; then - cat >>confdefs.h <<_ACEOF -#define ASM_TYPE_DIRECTIVE_PREFIX ${libc_cv_asm_type_prefix} -_ACEOF - -fi - { $as_echo "$as_me:$LINENO: checking for assembler gnu_unique_object symbol type" >&5 $as_echo_n "checking for assembler gnu_unique_object symbol type... " >&6; } if test "${libc_cv_asm_unique_object+set}" = set; then @@ -6182,37 +6188,6 @@ _ACEOF fi -# For the multi-arch option we need support in the assembler. -if test "$multi_arch" = yes; then - if test "x$libc_cv_asm_type_prefix" != xno; then -{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5 -$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; } -if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <&5 2>&5; -then - libc_cv_asm_gnu_indirect_function=yes -else - libc_cv_asm_gnu_indirect_function=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5 -$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; } - else - libc_cv_asm_gnu_indirect_function=no - fi - if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then - { { $as_echo "$as_me:$LINENO: error: --enable-multi-arch support requires assembler and linker support" >&5 -$as_echo "$as_me: error: --enable-multi-arch support requires assembler and linker support" >&2;} - { (exit 1); exit 1; }; } - fi -fi - { $as_echo "$as_me:$LINENO: checking for .symver assembler directive" >&5 $as_echo_n "checking for .symver assembler directive... " >&6; } if test "${libc_cv_asm_symver_directive+set}" = set; then @@ -8766,8 +8741,7 @@ libc_cv_gcc_unwind_find_fde=no libc_cv_idn=no # Iterate over all the sysdep directories we will use, running their -# configure fragments, and looking for a uname implementation. -uname= +# configure fragments. for dir in $sysnames; do case $dir in /*) dest=$dir ;; @@ -8778,15 +8752,6 @@ for dir in $sysnames; do $as_echo "running configure fragment for $dir" >&6; } . $dest/configure fi - - if test -z "$uname"; then - if test -r $dest/uname.c || - test -r $dest/uname.S || - { test -r $dest/syscalls.list && - grep '^uname[ ]' $dest/syscalls.list >/dev/null; }; then - uname=$dir - fi - fi done if test x$libc_cv_gcc_unwind_find_fde = xyes; then @@ -8797,75 +8762,6 @@ _ACEOF fi -# If we will use the generic uname implementation, we must figure out what -# it will say by examining the system, and write the results in config-name.h. -if test "$uname" = "sysdeps/generic"; then - - uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'` - if test $uname_sysname != $config_os; then - config_release=`echo $config_os | sed s/$uname_sysname//` - fi - - { $as_echo "$as_me:$LINENO: checking OS release for uname" >&5 -$as_echo_n "checking OS release for uname... " >&6; } -if test "${libc_cv_uname_release+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -r /vmunix; then - kernel_id=`strings /vmunix | grep UNIX` - elif test -r /dynix; then - kernel_id=`strings /dynix | grep DYNIX` - else - kernel_id= - fi - - kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` - if test x`echo "$config_release" | sed "s/^$kernel_release//"` \ - != x$config_release; then - # The configuration release is a substring of the kernel release. - libc_cv_uname_release=$kernel_release - elif test x$config_release != x; then - libc_cv_uname_release=$config_release - elif test x$kernel_release != x; then - libc_cv_uname_release=$kernel_release - else - libc_cv_uname_release=unknown - fi -fi -{ $as_echo "$as_me:$LINENO: result: $libc_cv_uname_release" >&5 -$as_echo "$libc_cv_uname_release" >&6; } - uname_release="$libc_cv_uname_release" - - { $as_echo "$as_me:$LINENO: checking OS version for uname" >&5 -$as_echo_n "checking OS version for uname... " >&6; } -if test "${libc_cv_uname_version+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -r /vmunix; then - kernel_id=`strings /vmunix | grep UNIX` - elif test -r /dynix; then - kernel_id=`strings /dynix | grep DYNIX` - else - kernel_id= - fi - - kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` - if test -n "$kernel_version"; then - libc_cv_uname_version="$kernel_version" - else - libc_cv_uname_version=unknown - fi -fi -{ $as_echo "$as_me:$LINENO: result: $libc_cv_uname_version" >&5 -$as_echo "$libc_cv_uname_version" >&6; } - uname_version="$libc_cv_uname_version" - - config_uname=config-name.h:config-name.in -else - # For non-generic uname, we don't need to create config-name.h at all. - config_uname= -fi - cat >>confdefs.h <<\_ACEOF #define USE_IN_LIBIO 1 _ACEOF @@ -8966,7 +8862,7 @@ RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h` -ac_config_files="$ac_config_files config.make ${config_makefile} ${config_uname}" +ac_config_files="$ac_config_files config.make ${config_makefile}" ac_config_commands="$ac_config_commands default" @@ -9577,7 +9473,6 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;; "${config_makefile}") CONFIG_FILES="$CONFIG_FILES ${config_makefile}" ;; - "${config_uname}") CONFIG_FILES="$CONFIG_FILES ${config_uname}" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 diff --git a/libc/configure.in b/libc/configure.in index de0cee73d..63f9bde17 100644 --- a/libc/configure.in +++ b/libc/configure.in @@ -278,9 +278,6 @@ AC_ARG_ENABLE([multi-arch], [enable single DSO with optimizations for multiple architectures]), [multi_arch=$enableval], [multi_arch=default]) -if test x"$multi_arch" != xno; then - multi_arch_d=/multiarch -fi AC_ARG_ENABLE([experimental-malloc], AC_HELP_STRING([--enable-experimental-malloc], @@ -608,6 +605,90 @@ if test "$base_machine" = "i386"; then AC_DEFINE(USE_REGPARMS) fi +# For the multi-arch option we need support in the assembler. +AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support], + libc_cv_asm_gnu_indirect_function, [dnl +cat > conftest.s <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; +then + libc_cv_asm_gnu_indirect_function=yes +else + libc_cv_asm_gnu_indirect_function=no +fi +rm -f conftest*]) + +AC_MSG_CHECKING(whether .text pseudo-op must be used) +AC_CACHE_VAL(libc_cv_dot_text, [dnl +cat > conftest.s <&AS_MESSAGE_LOG_FD); then + libc_cv_dot_text=.text +fi +rm -f conftest*]) +if test -z "$libc_cv_dot_text"; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) +fi + +AC_CACHE_CHECK(for assembler global-symbol directive, + libc_cv_asm_global_directive, [dnl +libc_cv_asm_global_directive=UNKNOWN +for ac_globl in .globl .global .EXPORT; do + cat > conftest.s <&AS_MESSAGE_LOG_FD); then + libc_cv_asm_global_directive=${ac_globl} + fi + rm -f conftest* + test $libc_cv_asm_global_directive != UNKNOWN && break +done]) +if test $libc_cv_asm_global_directive = UNKNOWN; then + AC_MSG_ERROR(cannot determine asm global directive) +else + AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive}) +fi + +AC_CACHE_CHECK(for assembler .type directive prefix, + libc_cv_asm_type_prefix, [dnl +libc_cv_asm_type_prefix=no +for ac_try_prefix in '@' '%' '#'; do + cat > conftest.s <&AS_MESSAGE_LOG_FD); then + libc_cv_asm_type_prefix=${ac_try_prefix} + fi + rm -f conftest* + test "x$libc_cv_asm_type_prefix" != xno && break +done]) +if test "x$libc_cv_asm_type_prefix" != xno; then + AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix}) +fi + +if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then + if test x"$multi_arch" = xyes; then + AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support]) + else + multi_arch=no + fi +fi +if test x"$multi_arch" != xno; then + multi_arch_d=/multiarch +fi + # Compute the list of sysdep directories for this configuration. # This can take a while to compute. sysdep_dir=$srcdir/sysdeps @@ -727,29 +808,14 @@ done # If the assembler supports gnu_indirect_function symbol type and the # architecture supports multi-arch, we enable multi-arch by default. -if test "$multi_arch" = default; then -AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support], - libc_cv_asm_gnu_indirect_function, [dnl -cat > conftest.s <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; -then - libc_cv_asm_gnu_indirect_function=yes -else - libc_cv_asm_gnu_indirect_function=no -fi -rm -f conftest*]) +case $sysnames_add_ons$sysnames in +*"$multi_arch_d"*) + ;; +*) multi_arch=no - if test "$libc_cv_asm_gnu_indirect_function" = yes; then - case $sysnames_add_ons$sysnames in - *"$multi_arch_d"*) - multi_arch=yes - ;; - esac - fi -fi -if test x"$multi_arch" = xyes; then + ;; +esac +if test x"$multi_arch" != xno; then AC_DEFINE(USE_MULTIARCH) fi AC_SUBST(multi_arch) @@ -1210,43 +1276,6 @@ if test $libc_cv_need_minus_P = yes; then asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives." fi -AC_MSG_CHECKING(whether .text pseudo-op must be used) -AC_CACHE_VAL(libc_cv_dot_text, [dnl -cat > conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_dot_text=.text -fi -rm -f conftest*]) -if test -z "$libc_cv_dot_text"; then - AC_MSG_RESULT(no) -else - AC_MSG_RESULT(yes) -fi - -AC_CACHE_CHECK(for assembler global-symbol directive, - libc_cv_asm_global_directive, [dnl -libc_cv_asm_global_directive=UNKNOWN -for ac_globl in .globl .global .EXPORT; do - cat > conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_asm_global_directive=${ac_globl} - fi - rm -f conftest* - test $libc_cv_asm_global_directive != UNKNOWN && break -done]) -if test $libc_cv_asm_global_directive = UNKNOWN; then - AC_MSG_ERROR(cannot determine asm global directive) -else - AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive}) -fi - AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl cat > conftest.s < conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_asm_type_prefix=${ac_try_prefix} - fi - rm -f conftest* - test "x$libc_cv_asm_type_prefix" != xno && break -done]) -if test "x$libc_cv_asm_type_prefix" != xno; then - AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix}) -fi - AC_CACHE_CHECK(for assembler gnu_unique_object symbol type, libc_cv_asm_unique_object, [dnl cat > conftest.s < conftest.s <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; -then - libc_cv_asm_gnu_indirect_function=yes -else - libc_cv_asm_gnu_indirect_function=no -fi -rm -f conftest*]) - else - libc_cv_asm_gnu_indirect_function=no - fi - if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then - AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support]) - fi -fi - AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive, [cat > conftest.s </dev/null; }; then - uname=$dir - fi - fi -]dnl done if test x$libc_cv_gcc_unwind_find_fde = xyes; then @@ -2260,64 +2233,6 @@ if test x$libc_cv_gcc_unwind_find_fde = xyes; then fi AC_SUBST(libc_cv_gcc_unwind_find_fde) -# If we will use the generic uname implementation, we must figure out what -# it will say by examining the system, and write the results in config-name.h. -if test "$uname" = "sysdeps/generic"; then - -changequote(,)dnl - uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'` -changequote([,])dnl - if test $uname_sysname != $config_os; then - config_release=`echo $config_os | sed s/$uname_sysname//` - fi -dnl -AC_DEFUN(LIBC_KERNEL_ID, [dnl - if test -r /vmunix; then - kernel_id=`strings /vmunix | grep UNIX` - elif test -r /dynix; then - kernel_id=`strings /dynix | grep DYNIX` - else - kernel_id= - fi -])dnl - - AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl -LIBC_KERNEL_ID -changequote(,)dnl - kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` -changequote([,])dnl - if test x`echo "$config_release" | sed "s/^$kernel_release//"` \ - != x$config_release; then - # The configuration release is a substring of the kernel release. - libc_cv_uname_release=$kernel_release - elif test x$config_release != x; then - libc_cv_uname_release=$config_release - elif test x$kernel_release != x; then - libc_cv_uname_release=$kernel_release - else - libc_cv_uname_release=unknown - fi]) - uname_release="$libc_cv_uname_release" - - AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl -LIBC_KERNEL_ID -changequote(,)dnl - kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` -changequote([,])dnl - if test -n "$kernel_version"; then - libc_cv_uname_version="$kernel_version" - else - libc_cv_uname_version=unknown - fi]) - uname_version="$libc_cv_uname_version" - -AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl - config_uname=config-name.h:config-name.in -else - # For non-generic uname, we don't need to create config-name.h at all. - config_uname= -fi - dnl This is tested by existing code and it's simpler to avoid changing it. AC_DEFINE(USE_IN_LIBIO) @@ -2401,7 +2316,7 @@ RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h` AC_SUBST(VERSION) AC_SUBST(RELEASE) -AC_CONFIG_FILES([config.make ${config_makefile} ${config_uname}]) +AC_CONFIG_FILES([config.make ${config_makefile}]) AC_CONFIG_COMMANDS([default],[[ case $CONFIG_FILES in *config.make*) echo "$config_vars" >> config.make;; diff --git a/libc/debug/vdprintf_chk.c b/libc/debug/vdprintf_chk.c index 8f3d332a4..adb60262f 100644 --- a/libc/debug/vdprintf_chk.c +++ b/libc/debug/vdprintf_chk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2008 +/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2008, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -50,10 +50,10 @@ __vdprintf_chk (int d, int flags, const char *format, va_list arg) INTUSE(_IO_un_link) (&tmpfil); return EOF; } - tmpfil.file._IO_file_flags = - (_IO_mask_flags (&tmpfil.file, _IO_NO_READS, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING) - | _IO_DELETE_DONT_CLOSE); + tmpfil.file._flags |= _IO_DELETE_DONT_CLOSE; + + _IO_mask_flags (&tmpfil.file, _IO_NO_READS, + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n can only come from read-only format strings. */ diff --git a/libc/iconvdata/gconv-modules b/libc/iconvdata/gconv-modules index e70432fca..a31871645 100644 --- a/libc/iconvdata/gconv-modules +++ b/libc/iconvdata/gconv-modules @@ -938,7 +938,6 @@ module INTERNAL IBM922// IBM922 1 # from to module cost alias IBM-930// IBM930// alias CP930// IBM930// -alias EBCDIC-CP-AR2// IBM930// alias CSIBM930// IBM930// module IBM930// INTERNAL IBM930 1 module INTERNAL IBM930// IBM930 1 @@ -952,7 +951,6 @@ module INTERNAL IBM932// IBM932 1 # from to module cost alias IBM-933// IBM933// alias CP933// IBM933// -alias EBCDIC-CP-AR2// IBM933// alias CSIBM933// IBM933// module IBM933// INTERNAL IBM933 1 module INTERNAL IBM933// IBM933 1 @@ -960,7 +958,6 @@ module INTERNAL IBM933// IBM933 1 # from to module cost alias IBM-935// IBM935// alias CP935// IBM935// -alias EBCDIC-CP-AR2// IBM935// alias CSIBM935// IBM935// module IBM935// INTERNAL IBM935 1 module INTERNAL IBM935// IBM935 1 @@ -968,7 +965,6 @@ module INTERNAL IBM935// IBM935 1 # from to module cost alias IBM-937// IBM937// alias CP937// IBM937// -alias EBCDIC-CP-AR2// IBM937// alias CSIBM937// IBM937// module IBM937// INTERNAL IBM937 1 module INTERNAL IBM937// IBM937 1 @@ -976,7 +972,6 @@ module INTERNAL IBM937// IBM937 1 # from to module cost alias IBM-939// IBM939// alias CP939// IBM939// -alias EBCDIC-CP-AR2// IBM939// alias CSIBM939// IBM939// module IBM939// INTERNAL IBM939 1 module INTERNAL IBM939// IBM939 1 diff --git a/libc/include/rpc/pmap_clnt.h b/libc/include/rpc/pmap_clnt.h index 9a2208228..b9a7063bb 100644 --- a/libc/include/rpc/pmap_clnt.h +++ b/libc/include/rpc/pmap_clnt.h @@ -8,5 +8,10 @@ libc_hidden_proto (pmap_unset) /* Defined in pm_getport.c. */ extern int __get_socket (struct sockaddr_in *saddr) attribute_hidden internal_function; +extern u_short __libc_rpc_getport (struct sockaddr_in *address, u_long program, + u_long version, u_int protocol, + time_t timeout_sec, time_t tottimeout_sec) + internal_function; +libc_hidden_proto (__libc_rpc_getport) #endif diff --git a/libc/libio/iofdopen.c b/libc/libio/iofdopen.c index 0c449ed75..7f6e593e8 100644 --- a/libc/libio/iofdopen.c +++ b/libc/libio/iofdopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1994,1997,1998,1999,2000,2002,2003 +/* Copyright (C) 1993,1994,1997,1998,1999,2000,2002,2003,2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -172,9 +172,8 @@ _IO_new_fdopen (fd, mode) } new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE; - new_f->fp.file._IO_file_flags = - _IO_mask_flags (&new_f->fp.file, read_write, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); + _IO_mask_flags (&new_f->fp.file, read_write, + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); return &new_f->fp.file; } diff --git a/libc/libio/iofopncook.c b/libc/libio/iofopncook.c index 976ff5093..f36e4c741 100644 --- a/libc/libio/iofopncook.c +++ b/libc/libio/iofopncook.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,97,99,2000,2002,2004, 2005 +/* Copyright (C) 1993,95,97,99,2000,2002,2004, 2005, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -154,9 +154,8 @@ _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write, INTUSE(_IO_file_init) (&cfile->__fp); - cfile->__fp.file._IO_file_flags = - _IO_mask_flags (&cfile->__fp.file, read_write, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); + _IO_mask_flags (&cfile->__fp.file, read_write, + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); /* We use a negative number different from -1 for _fileno to mark that this special stream is not associated with a real file, but still has diff --git a/libc/libio/iovdprintf.c b/libc/libio/iovdprintf.c index 5284ff893..fb4a838a5 100644 --- a/libc/libio/iovdprintf.c +++ b/libc/libio/iovdprintf.c @@ -53,10 +53,10 @@ _IO_vdprintf (d, format, arg) INTUSE(_IO_un_link) (&tmpfil); return EOF; } - tmpfil.file._IO_file_flags = - (_IO_mask_flags (&tmpfil.file, _IO_NO_READS, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING) - | _IO_DELETE_DONT_CLOSE); + tmpfil.file._flags |= _IO_DELETE_DONT_CLOSE; + + _IO_mask_flags (&tmpfil.file, _IO_NO_READS, + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg); diff --git a/libc/libio/oldiofdopen.c b/libc/libio/oldiofdopen.c index c616b387f..a1fc6675a 100644 --- a/libc/libio/oldiofdopen.c +++ b/libc/libio/oldiofdopen.c @@ -130,9 +130,8 @@ _IO_old_fdopen (fd, mode) } new_f->fp.file._file._flags &= ~_IO_DELETE_DONT_CLOSE; - new_f->fp.file._file._IO_file_flags = - _IO_mask_flags (&new_f->fp.file._file, read_write, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); + _IO_mask_flags (&new_f->fp.file._file, read_write, + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); return (_IO_FILE *) &new_f->fp; } diff --git a/libc/manual/Makefile b/libc/manual/Makefile index 754bf127a..40c83be4c 100644 --- a/libc/manual/Makefile +++ b/libc/manual/Makefile @@ -243,7 +243,10 @@ ifdef objpfx .PHONY: stubs stubs: $(objpfx)stubs endif -$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%: +$(objpfx)stubs ../po/manual.pot: + $(make-target-directory) + touch $@ +$(objpfx)stamp%: $(make-target-directory) touch $@ diff --git a/libc/nis/nis_findserv.c b/libc/nis/nis_findserv.c index 472a2bf52..b1a9aa7e0 100644 --- a/libc/nis/nis_findserv.c +++ b/libc/nis/nis_findserv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000, 2001, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1997. @@ -47,15 +47,6 @@ struct cu_data }; -/* The following is the original routine from sunrpc/pm_getport.c. - The only change is the much shorter timeout. */ -/* - * pmap_getport.c - * Client interface to pmap rpc service. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - /* * Find the mapped port for program,version. * Calls the pmap service remotely to do the lookup. @@ -65,39 +56,7 @@ u_short __pmap_getnisport (struct sockaddr_in *address, u_long program, u_long version, u_int protocol) { - const struct timeval timeout = {1, 0}; - const struct timeval tottimeout = {1, 0}; - u_short port = 0; - int socket = -1; - CLIENT *client; - struct pmap parms; - - address->sin_port = htons (PMAPPORT); - client = clntudp_bufcreate (address, PMAPPROG, PMAPVERS, timeout, &socket, - RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); - if (client != (CLIENT *) NULL) - { - parms.pm_prog = program; - parms.pm_vers = version; - parms.pm_prot = protocol; - parms.pm_port = 0; /* not needed or used */ - if (CLNT_CALL (client, PMAPPROC_GETPORT, (xdrproc_t) xdr_pmap, - (caddr_t) & parms, (xdrproc_t) xdr_u_short, - (caddr_t) & port, tottimeout) != RPC_SUCCESS) - { - rpc_createerr.cf_stat = RPC_PMAPFAILURE; - clnt_geterr (client, &rpc_createerr.cf_error); - } - else - { - if (port == 0) - rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; - } - CLNT_DESTROY (client); - } - /* (void)close(socket); CLNT_DESTROY already closed it */ - address->sin_port = 0; - return port; + return __libc_rpc_getport (address, program, version, protocol, 1, 1); } /* This is now the public function, which should find the fastest server */ diff --git a/libc/nis/rpcsvc/nis.h b/libc/nis/rpcsvc/nis.h index 049545723..5c5c7bb41 100644 --- a/libc/nis/rpcsvc/nis.h +++ b/libc/nis/rpcsvc/nis.h @@ -1,31 +1,32 @@ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _RPCSVC_NIS_H @@ -42,7 +43,7 @@ __BEGIN_DECLS * * This file is the main include file for NIS clients. It contains * both the client library function defines and the various data - * structures used by the NIS service. It includes the file nis_tags.h + * structures used by the NIS service. It includes the file nis_tags.h * which defines the tag values. This allows the tags to change without * having to change the nis.x file. * @@ -119,8 +120,8 @@ enum nstype { typedef enum nstype nstype; struct oar_mask { - uint32_t oa_rights; - zotypes oa_otype; + uint32_t oa_rights; + zotypes oa_otype; }; typedef struct oar_mask oar_mask; diff --git a/libc/nis/rpcsvc/nis.x b/libc/nis/rpcsvc/nis.x index 54ddb05ec..e318af29a 100644 --- a/libc/nis/rpcsvc/nis.x +++ b/libc/nis/rpcsvc/nis.x @@ -1,31 +1,32 @@ %/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user or with the express written consent of -% * Sun Microsystems, Inc. +% * Copyright (c) 2010, Oracle America, Inc. % * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +% * Redistribution and use in source and binary forms, with or without +% * modification, are permitted provided that the following conditions are +% * met: % * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. +% * * Redistributions of source code must retain the above copyright +% * notice, this list of conditions and the following disclaimer. +% * * Redistributions in binary form must reproduce the above +% * copyright notice, this list of conditions and the following +% * disclaimer in the documentation and/or other materials +% * provided with the distribution. +% * * Neither the name of the "Oracle America, Inc." nor the names of its +% * contributors may be used to endorse or promote products derived +% * from this software without specific prior written permission. % * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. -% * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. -% * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 +% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +% * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +% * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +% * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +% * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +% * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +% * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. % */ #ifdef RPC_HDR @@ -34,7 +35,7 @@ % * % * This file is the main include file for NIS clients. It contains % * both the client library function defines and the various data -% * structures used by the NIS service. It includes the file nis_tags.h +% * structures used by the NIS service. It includes the file nis_tags.h % * which defines the tag values. This allows the tags to change without % * having to change the nis.x file. % * @@ -57,10 +58,10 @@ /* Errors that can be returned by the service */ enum nis_error { - NIS_SUCCESS = 0, /* A-ok, let's rock n roll */ - NIS_S_SUCCESS = 1, /* Name found (maybe) */ - NIS_NOTFOUND = 2, /* Name definitely not found */ - NIS_S_NOTFOUND = 3, /* Name maybe not found */ + NIS_SUCCESS = 0, /* A-ok, let's rock n roll */ + NIS_S_SUCCESS = 1, /* Name found (maybe) */ + NIS_NOTFOUND = 2, /* Name definitely not found */ + NIS_S_NOTFOUND = 3, /* Name maybe not found */ NIS_CACHEEXPIRED = 4, /* Name exists but cache out of date */ NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */ NIS_UNKNOWNOBJ = 6, /* Object type is bogus */ @@ -81,7 +82,7 @@ enum nis_error { NIS_NOTUNIQUE = 21, /* Value is not uniques (entry) */ NIS_IBMODERROR = 22, /* Inf. Base. Modify error. */ NIS_NOSUCHTABLE = 23, /* Name for table was wrong */ - NIS_TYPEMISMATCH = 24, /* Entry and table type mismatch */ + NIS_TYPEMISMATCH = 24, /* Entry and table type mismatch */ NIS_LINKNAMEERROR = 25, /* Link points to bogus name */ NIS_PARTIAL = 26, /* Partial success, found table */ NIS_TOOMANYATTRS = 27, /* Too many attributes */ @@ -118,9 +119,9 @@ enum nis_error { struct nis_result { nis_error status; /* Status of the response */ - nis_object objects<>; /* objects found */ - netobj cookie; /* Cookie Data */ - uint32_t zticks; /* server ticks */ + nis_object objects<>; /* objects found */ + netobj cookie; /* Cookie Data */ + uint32_t zticks; /* server ticks */ uint32_t dticks; /* DBM ticks. */ uint32_t aticks; /* Cache (accel) ticks */ uint32_t cticks; /* Client ticks */ @@ -148,9 +149,9 @@ struct ns_request { */ struct ib_request { - nis_name ibr_name; /* The name of the Table */ - nis_attr ibr_srch<>; /* The search critereia */ - uint32_t ibr_flags; /* Optional flags */ + nis_name ibr_name; /* The name of the Table */ + nis_attr ibr_srch<>; /* The search critereia */ + uint32_t ibr_flags; /* Optional flags */ nis_object ibr_obj<1>; /* optional object (add/modify) */ nis_server ibr_cbhost<1>; /* Optional callback info */ u_int ibr_bufsize; /* Optional first/next bufsize */ @@ -177,11 +178,11 @@ struct ping_args { */ enum log_entry_t { LOG_NOP = 0, - ADD_NAME = 1, /* Name Added to name space */ - REM_NAME = 2, /* Name removed from name space */ - MOD_NAME_OLD = 3, /* Name was modified in the name space */ - MOD_NAME_NEW = 4, /* Name was modified in the name space */ - ADD_IBASE = 5, /* Entry added to information base */ + ADD_NAME = 1, /* Name Added to name space */ + REM_NAME = 2, /* Name removed from name space */ + MOD_NAME_OLD = 3, /* Name was modified in the name space */ + MOD_NAME_NEW = 4, /* Name was modified in the name space */ + ADD_IBASE = 5, /* Entry added to information base */ REM_IBASE = 6, /* Entry removed from information base */ MOD_IBASE = 7, /* Entry was modified in information base */ UPD_STAMP = 8 /* Update timestamp (used as fenceposts) */ @@ -195,24 +196,24 @@ enum log_entry_t { * 'name'. */ struct log_entry { - uint32_t le_time; /* Time in seconds */ - log_entry_t le_type; /* Type of log entry */ + uint32_t le_time; /* Time in seconds */ + log_entry_t le_type; /* Type of log entry */ nis_name le_princp; /* Principal making the change */ - nis_name le_name; /* Name of table/dir involved */ + nis_name le_name; /* Name of table/dir involved */ nis_attr le_attrs<>; /* List of AV pairs. */ - nis_object le_object; /* Actual object value */ + nis_object le_object; /* Actual object value */ }; struct log_result { - nis_error lr_status; /* The status itself */ + nis_error lr_status; /* The status itself */ netobj lr_cookie; /* Used by the dump callback */ - log_entry lr_entries<>; /* zero or more entries */ + log_entry lr_entries<>; /* zero or more entries */ }; struct cp_result { - nis_error cp_status; /* Status of the checkpoint */ - uint32_t cp_zticks; /* Service 'ticks' */ - uint32_t cp_dticks; /* Database 'ticks' */ + nis_error cp_status; /* Status of the checkpoint */ + uint32_t cp_zticks; /* Service 'ticks' */ + uint32_t cp_dticks; /* Database 'ticks' */ }; /* @@ -222,7 +223,7 @@ struct cp_result { * and to set or reset state variables. */ struct nis_tag { - uint32_t tag_type; /* Statistic tag (may vary) */ + uint32_t tag_type; /* Statistic tag (may vary) */ string tag_val<>; /* Statistic value may also vary */ }; @@ -231,7 +232,7 @@ struct nis_taglist { }; struct dump_args { - nis_name da_dir; /* Directory to dump */ + nis_name da_dir; /* Directory to dump */ uint32_t da_time; /* From this timestamp */ nis_server da_cbhost<1>; /* Callback to use. */ }; @@ -243,9 +244,9 @@ struct fd_args { struct fd_result { nis_error status; /* Status returned by function */ - nis_name source; /* Source of this answer */ - opaque dir_data<>; /* Directory Data (XDR'ed) */ - opaque signature<>; /* Signature of the source */ + nis_name source; /* Source of this answer */ + opaque dir_data<>; /* Directory Data (XDR'ed) */ + opaque signature<>; /* Signature of the source */ }; %/* @@ -372,7 +373,7 @@ program NIS_PROG { % %/* Structure for storing dynamically allocated static data */ %struct nis_sdata { -% void *buf; /* Memory allocation pointer */ +% void *buf; /* Memory allocation pointer */ % u_int size; /* Buffer size */ %}; % diff --git a/libc/nis/rpcsvc/nis_callback.h b/libc/nis/rpcsvc/nis_callback.h index eca4ed9f0..6f05728e2 100644 --- a/libc/nis/rpcsvc/nis_callback.h +++ b/libc/nis/rpcsvc/nis_callback.h @@ -1,31 +1,32 @@ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _RPCSVC_NIS_CALLBACK_H #define _RPCSVC_NIS_CALLBACK_H 1 diff --git a/libc/nis/rpcsvc/nis_callback.x b/libc/nis/rpcsvc/nis_callback.x index 48178655c..0fdca9eee 100644 --- a/libc/nis/rpcsvc/nis_callback.x +++ b/libc/nis/rpcsvc/nis_callback.x @@ -1,44 +1,42 @@ %/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user or with the express written consent of -% * Sun Microsystems, Inc. +% * Copyright (c) 2010, Oracle America, Inc. % * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +% * Redistribution and use in source and binary forms, with or without +% * modification, are permitted provided that the following conditions are +% * met: % * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. +% * * Redistributions of source code must retain the above copyright +% * notice, this list of conditions and the following disclaimer. +% * * Redistributions in binary form must reproduce the above +% * copyright notice, this list of conditions and the following +% * disclaimer in the documentation and/or other materials +% * provided with the distribution. +% * * Neither the name of the "Oracle America, Inc." nor the names of its +% * contributors may be used to endorse or promote products derived +% * from this software without specific prior written permission. % * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. -% * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. -% * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 +% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +% * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +% * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +% * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +% * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +% * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +% * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. % */ /* * nis_callback.x - * - * Copyright (c) 1988-1992 Sun Microsystems Inc - * All Rights Reserved. */ -%#pragma ident "@(#)nis_callback.x 1.7 94/05/03 SMI" +%#pragma ident "@(#)nis_callback.x 1.7 94/05/03" /* - * "@(#)zns_cback.x 1.2 90/09/10 Copyr 1990 Sun Micro" + * "@(#)zns_cback.x 1.2 90/09/10" * * RPCL description of the Callback Service. */ diff --git a/libc/nis/rpcsvc/nis_object.x b/libc/nis/rpcsvc/nis_object.x index 43e7688bc..774b38fa9 100644 --- a/libc/nis/rpcsvc/nis_object.x +++ b/libc/nis/rpcsvc/nis_object.x @@ -1,11 +1,37 @@ /* * nis_object.x * - * Copyright (c) 1988-1992 Sun Microsystems Inc - * All Rights Reserved. + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -%#pragma ident "@(#)nis_object.x 1.12 97/11/19 SMI" +%#pragma ident "@(#)nis_object.x 1.12 97/11/19" #if RPC_HDR % @@ -14,7 +40,7 @@ % #endif /* - * This file defines the format for a NIS object in RPC language. + * This file defines the format for a NIS object in RPC language. * It is included by the main .x file and the database access protocol * file. It is common because both of them need to deal with the same * type of object. Generating the actual code though is a bit messy because @@ -54,8 +80,8 @@ const NIS_PK_DHEXT = 4; /* Extended Diffie-Hellman for RPC-GSS */ * optional set of attribute/value pairs. */ struct nis_attr { - string zattr_ndx<>; /* name of the index */ - opaque zattr_val<>; /* Value for the attribute. */ + string zattr_ndx<>; /* name of the index */ + opaque zattr_val<>; /* Value for the attribute. */ }; typedef string nis_name<>; /* The NIS name itself. */ @@ -63,7 +89,7 @@ typedef string nis_name<>; /* The NIS name itself. */ /* NIS object types are defined by the following enumeration. The numbers * they use are based on the following scheme : * 0 - 1023 are reserved for Sun, - * 1024 - 2047 are defined to be private to a particular tree. + * 1024 - 2047 are defined to be private to a particular tree. * 2048 - 4095 are defined to be user defined. * 4096 - ... are reserved for future use. * @@ -74,22 +100,22 @@ typedef string nis_name<>; /* The NIS name itself. */ enum zotypes { - BOGUS_OBJ = 0, /* Uninitialized object structure */ - NO_OBJ = 1, /* NULL object (no data) */ - DIRECTORY_OBJ = 2, /* Directory object describing domain */ - GROUP_OBJ = 3, /* Group object (a list of names) */ - TABLE_OBJ = 4, /* Table object (a database schema) */ - ENTRY_OBJ = 5, /* Entry object (a database record) */ - LINK_OBJ = 6, /* A name link. */ - PRIVATE_OBJ = 7, /* Private object (all opaque data) */ + BOGUS_OBJ = 0, /* Uninitialized object structure */ + NO_OBJ = 1, /* NULL object (no data) */ + DIRECTORY_OBJ = 2, /* Directory object describing domain */ + GROUP_OBJ = 3, /* Group object (a list of names) */ + TABLE_OBJ = 4, /* Table object (a database schema) */ + ENTRY_OBJ = 5, /* Entry object (a database record) */ + LINK_OBJ = 6, /* A name link. */ + PRIVATE_OBJ = 7, /* Private object (all opaque data) */ - NIS_BOGUS_OBJ = 0, /* Uninitialized object structure */ - NIS_NO_OBJ = 1, /* NULL object (no data) */ - NIS_DIRECTORY_OBJ = 2, /* Directory object describing domain */ - NIS_GROUP_OBJ = 3, /* Group object (a list of names) */ - NIS_TABLE_OBJ = 4, /* Table object (a database schema) */ - NIS_ENTRY_OBJ = 5, /* Entry object (a database record) */ - NIS_LINK_OBJ = 6, /* A name link. */ + NIS_BOGUS_OBJ = 0, /* Uninitialized object structure */ + NIS_NO_OBJ = 1, /* NULL object (no data) */ + NIS_DIRECTORY_OBJ = 2, /* Directory object describing domain */ + NIS_GROUP_OBJ = 3, /* Group object (a list of names) */ + NIS_TABLE_OBJ = 4, /* Table object (a database schema) */ + NIS_ENTRY_OBJ = 5, /* Entry object (a database record) */ + NIS_LINK_OBJ = 6, /* A name link. */ NIS_PRIVATE_OBJ = 7 /* Private object (all opaque data) */ }; @@ -124,8 +150,8 @@ enum nstype { * administrator's approval. */ struct oar_mask { - uint32_t oa_rights; /* Access rights mask */ - zotypes oa_otype; /* Object type */ + uint32_t oa_rights; /* Access rights mask */ + zotypes oa_otype; /* Object type */ }; struct endpoint { @@ -140,17 +166,17 @@ struct endpoint { * the expected lifetime of this service. */ struct nis_server { - nis_name name; /* Principal name of the server */ - endpoint ep<>; /* Universal addr(s) for server */ + nis_name name; /* Principal name of the server */ + endpoint ep<>; /* Universal addr(s) for server */ uint32_t key_type; /* Public key type */ - netobj pkey; /* server's public key */ + netobj pkey; /* server's public key */ }; struct directory_obj { nis_name do_name; /* Name of the directory being served */ - nstype do_type; /* one of NIS, DNS, IVY, YP, or X.500 */ - nis_server do_servers<>; /* <0> == Primary name server */ - uint32_t do_ttl; /* Time To Live (for caches) */ + nstype do_type; /* one of NIS, DNS, IVY, YP, or X.500 */ + nis_server do_servers<>; /* <0> == Primary name server */ + uint32_t do_ttl; /* Time To Live (for caches) */ oar_mask do_armask<>; /* Create/Destroy rights by object type */ }; @@ -163,10 +189,10 @@ struct directory_obj { * entry but got to it through a LINK rather than directly. * If the entry is a "standalone" entry then this field is void. */ -const EN_BINARY = 1; /* Indicates value is binary data */ +const EN_BINARY = 1; /* Indicates value is binary data */ const EN_CRYPT = 2; /* Indicates the value is encrypted */ const EN_XDR = 4; /* Indicates the value is XDR encoded */ -const EN_MODIFIED = 8; /* Indicates entry is modified. */ +const EN_MODIFIED = 8; /* Indicates entry is modified. */ const EN_ASN1 = 64; /* Means contents use ASN.1 encoding */ struct entry_col { @@ -175,7 +201,7 @@ struct entry_col { }; struct entry_obj { - string en_type<>; /* Type of entry such as "passwd" */ + string en_type<>; /* Type of entry such as "passwd" */ entry_col en_cols<>; /* Value for the entry */ }; @@ -187,7 +213,7 @@ struct entry_obj { */ struct group_obj { uint32_t gr_flags; /* Flags controlling group */ - nis_name gr_members<>; /* List of names in group */ + nis_name gr_members<>; /* List of names in group */ }; /* @@ -200,7 +226,7 @@ struct group_obj { struct link_obj { zotypes li_rtype; /* Real type of the object */ nis_attr li_attrs<>; /* Attribute/Values for tables */ - nis_name li_name; /* The object's real NIS name */ + nis_name li_name; /* The object's real NIS name */ }; /* @@ -219,8 +245,8 @@ struct link_obj { * column value. */ -const TA_BINARY = 1; /* Means table data is binary */ -const TA_CRYPT = 2; /* Means value should be encrypted */ +const TA_BINARY = 1; /* Means table data is binary */ +const TA_CRYPT = 2; /* Means value should be encrypted */ const TA_XDR = 4; /* Means value is XDR encoded */ const TA_SEARCHABLE = 8; /* Means this column is searchable */ const TA_CASE = 16; /* Means this column is Case Sensitive */ @@ -228,16 +254,16 @@ const TA_MODIFIED = 32; /* Means this columns attrs are modified*/ const TA_ASN1 = 64; /* Means contents use ASN.1 encoding */ struct table_col { - string tc_name<64>; /* Column Name */ + string tc_name<64>; /* Column Name */ uint32_t tc_flags; /* control flags */ uint32_t tc_rights; /* Access rights mask */ }; struct table_obj { - string ta_type<64>; /* Table type such as "passwd" */ + string ta_type<64>; /* Table type such as "passwd" */ int ta_maxcol; /* Total number of columns */ - u_char ta_sep; /* Separator character */ - table_col ta_cols<>; /* The number of table indexes */ + u_char ta_sep; /* Separator character */ + table_col ta_cols<>; /* The number of table indexes */ string ta_path<>; /* A search path for this table */ }; @@ -245,24 +271,24 @@ struct table_obj { * This union joins together all of the currently known objects. */ union objdata switch (zotypes zo_type) { - case NIS_DIRECTORY_OBJ : - struct directory_obj di_data; - case NIS_GROUP_OBJ : - struct group_obj gr_data; - case NIS_TABLE_OBJ : - struct table_obj ta_data; - case NIS_ENTRY_OBJ: - struct entry_obj en_data; - case NIS_LINK_OBJ : - struct link_obj li_data; - case NIS_PRIVATE_OBJ : - opaque po_data<>; + case NIS_DIRECTORY_OBJ : + struct directory_obj di_data; + case NIS_GROUP_OBJ : + struct group_obj gr_data; + case NIS_TABLE_OBJ : + struct table_obj ta_data; + case NIS_ENTRY_OBJ: + struct entry_obj en_data; + case NIS_LINK_OBJ : + struct link_obj li_data; + case NIS_PRIVATE_OBJ : + opaque po_data<>; case NIS_NO_OBJ : void; - case NIS_BOGUS_OBJ : + case NIS_BOGUS_OBJ : + void; + default : void; - default : - void; }; /* @@ -281,7 +307,7 @@ union objdata switch (zotypes zo_type) { * new position and calculate the size. */ struct nis_oid { - uint32_t ctime; /* Time of objects creation */ + uint32_t ctime; /* Time of objects creation */ uint32_t mtime; /* Time of objects modification */ }; @@ -293,7 +319,7 @@ struct nis_object { nis_name zo_domain; /* The administrator for the object */ uint32_t zo_access; /* Access rights (owner, group, world) */ uint32_t zo_ttl; /* Object's time to live in seconds. */ - objdata zo_data; /* Data structure for this type */ + objdata zo_data; /* Data structure for this type */ }; #if RPC_HDR % diff --git a/libc/nis/rpcsvc/nis_tags.h b/libc/nis/rpcsvc/nis_tags.h index 9a24188f9..c2dc7fd26 100644 --- a/libc/nis/rpcsvc/nis_tags.h +++ b/libc/nis/rpcsvc/nis_tags.h @@ -1,5 +1,32 @@ /* - * Copyright (c) 1991, Sun Microsystems Inc. + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @@ -13,9 +40,9 @@ #define _RPCSVC_NIS_TAGS_H #if 0 -#pragma ident "@(#)nis_tags.h 1.16 96/10/25 SMI" +#pragma ident "@(#)nis_tags.h 1.16 96/10/25" #endif -/* from file: zns_tags.h 1.7 Copyright (c) 1990 Sun Microsystems */ +/* from file: zns_tags.h 1.7 */ #ifdef __cplusplus extern "C" { @@ -25,11 +52,11 @@ extern "C" { #define NIS_DIR "data" /* Lookup and List function flags */ -#define FOLLOW_LINKS (1<<0) /* Follow link objects */ -#define FOLLOW_PATH (1<<1) /* Follow the path in a table */ -#define HARD_LOOKUP (1<<2) /* Block until successful */ -#define ALL_RESULTS (1<<3) /* Retrieve all results */ -#define NO_CACHE (1<<4) /* Do not return 'cached' results */ +#define FOLLOW_LINKS (1<<0) /* Follow link objects */ +#define FOLLOW_PATH (1<<1) /* Follow the path in a table */ +#define HARD_LOOKUP (1<<2) /* Block until successful */ +#define ALL_RESULTS (1<<3) /* Retrieve all results */ +#define NO_CACHE (1<<4) /* Do not return 'cached' results */ #define MASTER_ONLY (1<<5) /* Get value only from master server */ #define EXPAND_NAME (1<<6) /* Expand partitially qualified names */ @@ -46,7 +73,7 @@ extern "C" { #define SOFT_LOOKUP (1<<14) /* The "old default" return on failure */ /* Transport specific modifications to the operation */ -#define USE_DGRAM (1<<16) /* Use a datagram transport */ +#define USE_DGRAM (1<<16) /* Use a datagram transport */ #define NO_AUTHINFO (1<<17) /* Don't bother attaching auth info */ /* @@ -55,14 +82,14 @@ extern "C" { * Statistic tags have values 2048 - 65535 * User Tags have values >2^16 */ -#define TAG_DEBUG 1 /* set debug level */ -#define TAG_STATS 2 /* Enable/disable statistics */ +#define TAG_DEBUG 1 /* set debug level */ +#define TAG_STATS 2 /* Enable/disable statistics */ #define TAG_GCACHE 3 /* Flush the Group Cache */ #define TAG_GCACHE_ALL TAG_GCACHE #define TAG_DCACHE 4 /* Flush the directory cache */ #define TAG_DCACHE_ONE TAG_DCACHE #define TAG_OCACHE 5 /* Flush the Object Cache */ -#define TAG_SECURE 6 /* Set the security level */ +#define TAG_SECURE 6 /* Set the security level */ #define TAG_TCACHE_ONE 7 /* Flush the table cache */ #define TAG_DCACHE_ALL 8 /* Flush entire directory cache */ #define TAG_TCACHE_ALL 9 /* Flush entire table cache */ @@ -91,8 +118,8 @@ extern "C" { * Declarations for the Group object flags. Currently * there are only 3. */ -#define IMPMEM_GROUPS 1 /* Implicit Membership allowed */ -#define RECURS_GROUPS 2 /* Recursive Groups allowed */ +#define IMPMEM_GROUPS 1 /* Implicit Membership allowed */ +#define RECURS_GROUPS 2 /* Recursive Groups allowed */ #define NEGMEM_GROUPS 4 /* Negative Groups allowed */ #ifdef __cplusplus diff --git a/libc/nis/rpcsvc/yp.h b/libc/nis/rpcsvc/yp.h index ffc13b81f..968b74c42 100644 --- a/libc/nis/rpcsvc/yp.h +++ b/libc/nis/rpcsvc/yp.h @@ -1,30 +1,32 @@ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __RPCSVC_YP_H__ diff --git a/libc/nis/rpcsvc/yp.x b/libc/nis/rpcsvc/yp.x index b1b25658e..269ae6f60 100644 --- a/libc/nis/rpcsvc/yp.x +++ b/libc/nis/rpcsvc/yp.x @@ -1,32 +1,34 @@ /* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @@ -163,12 +165,12 @@ struct ypresp_maplist { enum yppush_status { YPPUSH_SUCC = 1, /* Success */ - YPPUSH_AGE = 2, /* Master's version not newer */ + YPPUSH_AGE = 2, /* Master's version not newer */ YPPUSH_NOMAP = -1, /* Can't find server for map */ YPPUSH_NODOM = -2, /* Domain not supported */ YPPUSH_RSRC = -3, /* Local resource alloc failure */ YPPUSH_RPC = -4, /* RPC failure talking to server */ - YPPUSH_MADDR = -5, /* Can't get master address */ + YPPUSH_MADDR = -5, /* Can't get master address */ YPPUSH_YPERR = -6, /* YP server/map db error */ YPPUSH_BADARGS = -7, /* Request arguments bad */ YPPUSH_DBM = -8, /* Local dbm operation failed */ @@ -176,8 +178,8 @@ enum yppush_status { YPPUSH_SKEW = -10, /* Map version skew during transfer */ YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */ YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */ - YPPUSH_XFRERR = -13, /* ypxfr error */ - YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */ + YPPUSH_XFRERR = -13, /* ypxfr error */ + YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */ }; struct yppushresp_xfr { @@ -202,9 +204,9 @@ struct ypbind_binding { union ypbind_resp switch (ypbind_resptype ypbind_status) { case YPBIND_FAIL_VAL: - unsigned ypbind_error; + unsigned ypbind_error; case YPBIND_SUCC_VAL: - ypbind_binding ypbind_bindinfo; + ypbind_binding ypbind_bindinfo; }; /* Detailed failure reason codes for response field ypbind_error*/ diff --git a/libc/nis/rpcsvc/ypupd.h b/libc/nis/rpcsvc/ypupd.h index c53e69d0e..d07fd4d74 100644 --- a/libc/nis/rpcsvc/ypupd.h +++ b/libc/nis/rpcsvc/ypupd.h @@ -1,34 +1,32 @@ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -/* - * Copyright (c) 1986, 1990 by Sun Microsystems, Inc. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* from @(#)ypupdate_prot.x 1.3 91/03/11 TIRPC 1.0 */ diff --git a/libc/nis/yp_xdr.c b/libc/nis/yp_xdr.c index bdd5d8725..76e0f2f21 100644 --- a/libc/nis/yp_xdr.c +++ b/libc/nis/yp_xdr.c @@ -1,30 +1,32 @@ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include diff --git a/libc/nis/ypupdate_xdr.c b/libc/nis/ypupdate_xdr.c index 0f5469fa2..9f6d69f96 100644 --- a/libc/nis/ypupdate_xdr.c +++ b/libc/nis/ypupdate_xdr.c @@ -1,34 +1,32 @@ /* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. + * Copyright (c) 2010, Oracle America, Inc. * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -/* - * Copyright (c) 1986, 1990 by Sun Microsystems, Inc. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog index d4a1deb22..30631dcd1 100644 --- a/libc/nptl/ChangeLog +++ b/libc/nptl/ChangeLog @@ -1,3 +1,8 @@ +2010-09-03 Ulrich Drepper + + * sysdeps/pthread/allocalim.h (__libc_use_alloca): Expect blocks are + small. + 2010-08-10 Dinakar Guniguntala Stefan Hajnoczi diff --git a/libc/nptl/sysdeps/pthread/allocalim.h b/libc/nptl/sysdeps/pthread/allocalim.h index f13c3a330..8265db1c4 100644 --- a/libc/nptl/sysdeps/pthread/allocalim.h +++ b/libc/nptl/sysdeps/pthread/allocalim.h @@ -1,5 +1,5 @@ /* Determine whether block of given size can be allocated on the stack or not. - Copyright (C) 2002, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2010 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 @@ -26,5 +26,5 @@ __always_inline __libc_use_alloca (size_t size) { return (__builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1) - || __libc_alloca_cutoff (size)); + || __builtin_expect (__libc_alloca_cutoff (size), 1)); } diff --git a/libc/posix/Makefile b/libc/posix/Makefile index 96a248a92..ee5d7efa9 100644 --- a/libc/posix/Makefile +++ b/libc/posix/Makefile @@ -170,6 +170,14 @@ endif OPTION_EGLIBC_INET-CFLAGS-$(OPTION_EGLIBC_INET) = -DUSE_NSCD=1 +# If we will use the generic uname implementation, we must figure out what +# it will say by examining the system, and write the results in config-name.h. +uname.c: $(objpfx)config-name.h +$(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make + $< '$(config-os)' '$(config-release)' \ + '$(config-machine)-$(config-vendor)' > $@.new + mv -f $@.new $@ + CFLAGS-regex.c = -Wno-strict-prototypes CFLAGS-getaddrinfo.c = -DRESOLVER -fexceptions $(OPTION_EGLIBC_INET-CFLAGS-y) CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables diff --git a/libc/resolv/res_init.c b/libc/resolv/res_init.c index 40dbe7d7e..202569dda 100644 --- a/libc/resolv/res_init.c +++ b/libc/resolv/res_init.c @@ -176,13 +176,6 @@ __res_vinit(res_state statp, int preinit) { statp->id = res_randomid(); } -#ifdef USELOOPBACK - statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); -#else - statp->nsaddr.sin_addr.s_addr = INADDR_ANY; -#endif - statp->nsaddr.sin_family = AF_INET; - statp->nsaddr.sin_port = htons(NAMESERVER_PORT); statp->nscount = 0; statp->ndots = 1; statp->pfcode = 0; @@ -321,24 +314,24 @@ __res_vinit(res_state statp, int preinit) { nserv++; #ifdef _LIBC nservall++; - } else { - struct in6_addr a6; - char *el; + } else { + struct in6_addr a6; + char *el; - if ((el = strchr(cp, '\n')) != NULL) - *el = '\0'; + if ((el = strchr(cp, '\n')) != NULL) + *el = '\0'; if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL) *el = '\0'; - if ((*cp != '\0') && - (inet_pton(AF_INET6, cp, &a6) > 0)) { - struct sockaddr_in6 *sa6; - - sa6 = malloc(sizeof(*sa6)); - if (sa6 != NULL) { - sa6->sin6_family = AF_INET6; - sa6->sin6_port = htons(NAMESERVER_PORT); + if ((*cp != '\0') && + (inet_pton(AF_INET6, cp, &a6) > 0)) { + struct sockaddr_in6 *sa6; + + sa6 = malloc(sizeof(*sa6)); + if (sa6 != NULL) { + sa6->sin6_family = AF_INET6; + sa6->sin6_port = htons(NAMESERVER_PORT); sa6->sin6_flowinfo = 0; - sa6->sin6_addr = a6; + sa6->sin6_addr = a6; if (__builtin_expect (el == NULL, 1)) sa6->sin6_scope_id = 0; @@ -365,9 +358,9 @@ __res_vinit(res_state statp, int preinit) { statp->_u._ext.nsaddrs[nservall] = sa6; statp->_u._ext.nssocks[nservall] = -1; statp->_u._ext.nsmap[nservall] = MAXNS + 1; - nservall++; - } - } + nservall++; + } + } #endif } continue; @@ -433,6 +426,11 @@ __res_vinit(res_state statp, int preinit) { #endif (void) fclose(fp); } + if (__builtin_expect(statp->nscount == 0, 0)) { + statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); + statp->nsaddr.sin_family = AF_INET; + statp->nsaddr.sin_port = htons(NAMESERVER_PORT); + } if (statp->defdname[0] == 0 && __gethostname(buf, sizeof(statp->defdname) - 1) == 0 && (cp = strchr(buf, '.')) != NULL) @@ -538,12 +536,12 @@ res_setoptions(res_state statp, const char *options, const char *source) { } else if (!strncmp(cp, "no-check-names", sizeof("no-check-names") - 1)) { statp->options |= RES_NOCHECKNAME; - } else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { + } else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { statp->options |= RES_USE_EDNS0; - } else if (!strncmp(cp, "single-request-reopen", + } else if (!strncmp(cp, "single-request-reopen", sizeof("single-request-reopen") - 1)) { statp->options |= RES_SNGLKUPREOP; - } else if (!strncmp(cp, "single-request", + } else if (!strncmp(cp, "single-request", sizeof("single-request") - 1)) { statp->options |= RES_SNGLKUP; } else { diff --git a/libc/scripts/config-uname.sh b/libc/scripts/config-uname.sh new file mode 100755 index 000000000..cf32ca53b --- /dev/null +++ b/libc/scripts/config-uname.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +config_os=$1 +config_release=$2 +uname_machine=$3 + +uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'` +if test $uname_sysname != $config_os; then + config_release=`echo $config_os | sed s/$uname_sysname//` +fi + +if test -r /vmunix; then + kernel_id=`strings /vmunix | grep UNIX` +elif test -r /dynix; then + kernel_id=`strings /dynix | grep DYNIX` +else + kernel_id= +fi + +kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` +if test x`echo "$config_release" | sed "s/^$kernel_release//"` \ + != x$config_release; then + # The configuration release is a substring of the kernel release. + uname_release=$kernel_release +elif test x$config_release != x; then + uname_release=$config_release +elif test x$kernel_release != x; then + uname_release=$kernel_release +else + uname_release=unknown +fi + +kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` +if test -n "$kernel_version"; then + uname_version="$kernel_version" +else + uname_version=unknown +fi + +cat <= 0; --i) retval[i] = 0; diff --git a/libc/sunrpc/Versions b/libc/sunrpc/Versions index d2d8e81ac..a11dd8d36 100644 --- a/libc/sunrpc/Versions +++ b/libc/sunrpc/Versions @@ -117,6 +117,6 @@ libc { xdr_quad_t; xdr_u_quad_t; } GLIBC_PRIVATE { - __libc_clntudp_bufcreate; + __libc_clntudp_bufcreate; __libc_rpc_getport; } } diff --git a/libc/sunrpc/pm_getport.c b/libc/sunrpc/pm_getport.c index 66340c0a5..da3477603 100644 --- a/libc/sunrpc/pm_getport.c +++ b/libc/sunrpc/pm_getport.c @@ -39,11 +39,6 @@ #include #include -static const struct timeval timeout = -{5, 0}; -static const struct timeval tottimeout = -{60, 0}; - /* * Create a socket that is locally bound to a non-reserve port. For * any failures, -1 is returned which will cause the RPC code to @@ -81,16 +76,24 @@ __get_socket (struct sockaddr_in *saddr) /* * Find the mapped port for program,version. + * Internal version with additional parameters. * Calls the pmap service remotely to do the lookup. * Returns 0 if no map exists. */ u_short -pmap_getport (address, program, version, protocol) +internal_function +__libc_rpc_getport (address, program, version, protocol, timeout_sec, + tottimeout_sec) struct sockaddr_in *address; u_long program; u_long version; u_int protocol; + time_t timeout_sec; + time_t tottimeout_sec; { + const struct timeval timeout = {timeout_sec, 0}; + const struct timeval tottimeout = {tottimeout_sec, 0}; + u_short port = 0; int socket = -1; CLIENT *client; @@ -137,4 +140,21 @@ pmap_getport (address, program, version, protocol) address->sin_port = 0; return port; } +libc_hidden_def (__libc_rpc_getport) + + +/* + * Find the mapped port for program,version. + * Calls the pmap service remotely to do the lookup. + * Returns 0 if no map exists. + */ +u_short +pmap_getport (address, program, version, protocol) + struct sockaddr_in *address; + u_long program; + u_long version; + u_int protocol; +{ + return __libc_rpc_getport (address, program, version, protocol, 5, 60); +} libc_hidden_def (pmap_getport) diff --git a/libc/sunrpc/rpc_parse.h b/libc/sunrpc/rpc_parse.h index 55a999da8..e2e2f1e10 100644 --- a/libc/sunrpc/rpc_parse.h +++ b/libc/sunrpc/rpc_parse.h @@ -1,6 +1,5 @@ /* @(#)rpc_parse.h 1.3 90/08/29 - -/* + * * Copyright (c) 2010, Oracle America, Inc. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/libc/sysdeps/i386/i686/multiarch/Makefile b/libc/sysdeps/i386/i686/multiarch/Makefile index 12bcfc273..32286d8d3 100644 --- a/libc/sysdeps/i386/i686/multiarch/Makefile +++ b/libc/sysdeps/i386/i686/multiarch/Makefile @@ -9,9 +9,11 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \ memmove-ssse3-rep bcopy-ssse3 bcopy-ssse3-rep \ memset-sse2-rep bzero-sse2-rep strcmp-ssse3 \ strcmp-sse4 strncmp-c strncmp-ssse3 strncmp-sse4 \ - memcmp-ssse3 memcmp-sse4 strcasestr-nonascii + memcmp-ssse3 memcmp-sse4 strcasestr-nonascii varshift \ + strlen-sse2 strlen-sse2-bsf ifeq (yes,$(config-cflags-sse4)) sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c +CFLAGS-varshift.c += -msse4 CFLAGS-strcspn-c.c += -msse4 CFLAGS-strpbrk-c.c += -msse4 CFLAGS-strspn-c.c += -msse4 diff --git a/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S b/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S new file mode 100644 index 000000000..0dc651f01 --- /dev/null +++ b/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S @@ -0,0 +1,127 @@ +/* strlen with SSE2 and BSF + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Intel Corporation. + 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. */ + +#if defined SHARED && !defined NOT_IN_libc + +#include +#include "asm-syntax.h" + +#define CFI_PUSH(REG) \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (REG, 0) + +#define CFI_POP(REG) \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (REG) + +#define PUSH(REG) pushl REG; CFI_PUSH (REG) +#define POP(REG) popl REG; CFI_POP (REG) +#define PARMS 4 + 8 /* Preserve ESI and EDI. */ +#define STR PARMS +#define ENTRANCE PUSH (%esi); PUSH (%edi); cfi_remember_state +#define RETURN POP (%edi); POP (%esi); ret; \ + cfi_restore_state; cfi_remember_state + + .text +ENTRY ( __strlen_sse2_bsf) + ENTRANCE + mov STR(%esp), %edi + xor %eax, %eax + mov %edi, %ecx + and $0x3f, %ecx + pxor %xmm0, %xmm0 + cmp $0x30, %ecx + ja L(next) + movdqu (%edi), %xmm1 + pcmpeqb %xmm1, %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + jnz L(exit_less16) + mov %edi, %eax + and $-16, %eax + jmp L(align16_start) +L(next): + + mov %edi, %eax + and $-16, %eax + pcmpeqb (%eax), %xmm0 + mov $-1, %esi + sub %eax, %ecx + shl %cl, %esi + pmovmskb %xmm0, %edx + and %esi, %edx + jnz L(exit) +L(align16_start): + pxor %xmm0, %xmm0 + pxor %xmm1, %xmm1 + pxor %xmm2, %xmm2 + pxor %xmm3, %xmm3 + .p2align 4 +L(align16_loop): + pcmpeqb 16(%eax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + jnz L(exit16) + + pcmpeqb 32(%eax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + jnz L(exit32) + + pcmpeqb 48(%eax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + jnz L(exit48) + + pcmpeqb 64(%eax), %xmm3 + pmovmskb %xmm3, %edx + lea 64(%eax), %eax + test %edx, %edx + jz L(align16_loop) +L(exit): + sub %edi, %eax +L(exit_less16): + bsf %edx, %edx + add %edx, %eax + RETURN +L(exit16): + sub %edi, %eax + bsf %edx, %edx + add %edx, %eax + add $16, %eax + RETURN +L(exit32): + sub %edi, %eax + bsf %edx, %edx + add %edx, %eax + add $32, %eax + RETURN +L(exit48): + sub %edi, %eax + bsf %edx, %edx + add %edx, %eax + add $48, %eax + POP (%edi) + POP (%esi) + ret + +END ( __strlen_sse2_bsf) + +#endif diff --git a/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S b/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S new file mode 100644 index 000000000..65809d985 --- /dev/null +++ b/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S @@ -0,0 +1,347 @@ +/* strlen with SSE2 + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Intel Corporation. + 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. */ + +#if defined SHARED && !defined NOT_IN_libc + +#include +#include "asm-syntax.h" + +#define CFI_PUSH(REG) \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (REG, 0) + +#define CFI_POP(REG) \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (REG) + +#define PUSH(REG) pushl REG; CFI_PUSH (REG) +#define POP(REG) popl REG; CFI_POP (REG) +#define PARMS 4 +#define STR PARMS +#define ENTRANCE +#define RETURN ret + + .text +ENTRY (__strlen_sse2) + ENTRANCE + mov STR(%esp), %edx + xor %eax, %eax + cmpb $0, (%edx) + jz L(exit_tail0) + cmpb $0, 1(%edx) + jz L(exit_tail1) + cmpb $0, 2(%edx) + jz L(exit_tail2) + cmpb $0, 3(%edx) + jz L(exit_tail3) + cmpb $0, 4(%edx) + jz L(exit_tail4) + cmpb $0, 5(%edx) + jz L(exit_tail5) + cmpb $0, 6(%edx) + jz L(exit_tail6) + cmpb $0, 7(%edx) + jz L(exit_tail7) + cmpb $0, 8(%edx) + jz L(exit_tail8) + cmpb $0, 9(%edx) + jz L(exit_tail9) + cmpb $0, 10(%edx) + jz L(exit_tail10) + cmpb $0, 11(%edx) + jz L(exit_tail11) + cmpb $0, 12(%edx) + jz L(exit_tail12) + cmpb $0, 13(%edx) + jz L(exit_tail13) + cmpb $0, 14(%edx) + jz L(exit_tail14) + cmpb $0, 15(%edx) + jz L(exit_tail15) + pxor %xmm0, %xmm0 + mov %edx, %eax + mov %edx, %ecx + and $-16, %eax + add $16, %ecx + add $16, %eax + + pcmpeqb (%eax), %xmm0 + pmovmskb %xmm0, %edx + pxor %xmm1, %xmm1 + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm1 + pmovmskb %xmm1, %edx + pxor %xmm2, %xmm2 + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + + pcmpeqb (%eax), %xmm2 + pmovmskb %xmm2, %edx + pxor %xmm3, %xmm3 + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + pcmpeqb (%eax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%eax), %eax + jnz L(exit) + + and $-0x40, %eax + PUSH (%esi) + PUSH (%edi) + PUSH (%ebx) + PUSH (%ebp) + xor %ebp, %ebp +L(aligned_64): + pcmpeqb (%eax), %xmm0 + pcmpeqb 16(%eax), %xmm1 + pcmpeqb 32(%eax), %xmm2 + pcmpeqb 48(%eax), %xmm3 + pmovmskb %xmm0, %edx + pmovmskb %xmm1, %esi + pmovmskb %xmm2, %edi + pmovmskb %xmm3, %ebx + or %edx, %ebp + or %esi, %ebp + or %edi, %ebp + or %ebx, %ebp + lea 64(%eax), %eax + jz L(aligned_64) +L(48leave): + test %edx, %edx + jnz L(aligned_64_exit_16) + test %esi, %esi + jnz L(aligned_64_exit_32) + test %edi, %edi + jnz L(aligned_64_exit_48) + mov %ebx, %edx + lea (%eax), %eax + jmp L(aligned_64_exit) +L(aligned_64_exit_48): + lea -16(%eax), %eax + mov %edi, %edx + jmp L(aligned_64_exit) +L(aligned_64_exit_32): + lea -32(%eax), %eax + mov %esi, %edx + jmp L(aligned_64_exit) +L(aligned_64_exit_16): + lea -48(%eax), %eax +L(aligned_64_exit): + POP (%ebp) + POP (%ebx) + POP (%edi) + POP (%esi) +L(exit): + sub %ecx, %eax + test %dl, %dl + jz L(exit_high) + test $0x01, %dl + jnz L(exit_tail0) + + test $0x02, %dl + jnz L(exit_tail1) + + test $0x04, %dl + jnz L(exit_tail2) + + test $0x08, %dl + jnz L(exit_tail3) + + test $0x10, %dl + jnz L(exit_tail4) + + test $0x20, %dl + jnz L(exit_tail5) + + test $0x40, %dl + jnz L(exit_tail6) + add $7, %eax +L(exit_tail0): + RETURN + +L(exit_high): + add $8, %eax + test $0x01, %dh + jnz L(exit_tail0) + + test $0x02, %dh + jnz L(exit_tail1) + + test $0x04, %dh + jnz L(exit_tail2) + + test $0x08, %dh + jnz L(exit_tail3) + + test $0x10, %dh + jnz L(exit_tail4) + + test $0x20, %dh + jnz L(exit_tail5) + + test $0x40, %dh + jnz L(exit_tail6) + add $7, %eax + RETURN + + .p2align 4 +L(exit_tail1): + add $1, %eax + RETURN + +L(exit_tail2): + add $2, %eax + RETURN + +L(exit_tail3): + add $3, %eax + RETURN + +L(exit_tail4): + add $4, %eax + RETURN + +L(exit_tail5): + add $5, %eax + RETURN + +L(exit_tail6): + add $6, %eax + RETURN + +L(exit_tail7): + add $7, %eax + RETURN + +L(exit_tail8): + add $8, %eax + RETURN + +L(exit_tail9): + add $9, %eax + RETURN + +L(exit_tail10): + add $10, %eax + RETURN + +L(exit_tail11): + add $11, %eax + RETURN + +L(exit_tail12): + add $12, %eax + RETURN + +L(exit_tail13): + add $13, %eax + RETURN + +L(exit_tail14): + add $14, %eax + RETURN + +L(exit_tail15): + add $15, %eax + ret + +END (__strlen_sse2) + +#endif diff --git a/libc/sysdeps/i386/i686/multiarch/strlen.S b/libc/sysdeps/i386/i686/multiarch/strlen.S index 9786add74..9d465c845 100644 --- a/libc/sysdeps/i386/i686/multiarch/strlen.S +++ b/libc/sysdeps/i386/i686/multiarch/strlen.S @@ -1,5 +1,5 @@ /* Multiple versions of strlen - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Intel Corporation. This file is part of the GNU C Library. @@ -48,6 +48,9 @@ ENTRY(strlen) 1: leal __strlen_ia32@GOTOFF(%ebx), %eax testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx) jz 2f + leal __strlen_sse2_bsf@GOTOFF(%ebx), %eax + testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + jz 2f leal __strlen_sse2@GOTOFF(%ebx), %eax 2: popl %ebx cfi_adjust_cfa_offset (-4); @@ -55,84 +58,6 @@ ENTRY(strlen) ret END(strlen) -#define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ - cfi_restore (REG) - -#define RETURN popl %esi; CFI_POP (esi); ret - - .text -ENTRY (__strlen_sse2) -/* - * This implementation uses SSE instructions to compare up to 16 bytes - * at a time looking for the end of string (null char). - */ - pushl %esi - cfi_adjust_cfa_offset (4) - cfi_rel_offset (%esi, 0) - mov 8(%esp), %eax - mov %eax, %ecx - pxor %xmm0, %xmm0 /* 16 null chars */ - mov %eax, %esi - and $15, %ecx - jz 1f /* string is 16 byte aligned */ - - /* - * Unaligned case. Round down to 16-byte boundary before comparing - * 16 bytes for a null char. The code then compensates for any extra chars - * preceding the start of the string. - */ - and $-16, %esi - - pcmpeqb (%esi), %xmm0 - lea 16(%eax), %esi - pmovmskb %xmm0, %edx - - shr %cl, %edx /* Compensate for bytes preceding the string */ - test %edx, %edx - jnz 2f - sub %ecx, %esi /* no null, adjust to next 16-byte boundary */ - pxor %xmm0, %xmm0 /* clear xmm0, may have been changed... */ - - .p2align 4 -1: /* 16 byte aligned */ - pcmpeqb (%esi), %xmm0 /* look for null bytes */ - pmovmskb %xmm0, %edx /* move each byte mask of %xmm0 to edx */ - - add $16, %esi /* prepare to search next 16 bytes */ - test %edx, %edx /* if no null byte, %edx must be 0 */ - jnz 2f /* found a null */ - - pcmpeqb (%esi), %xmm0 - pmovmskb %xmm0, %edx - add $16, %esi - test %edx, %edx - jnz 2f - - pcmpeqb (%esi), %xmm0 - pmovmskb %xmm0, %edx - add $16, %esi - test %edx, %edx - jnz 2f - - pcmpeqb (%esi), %xmm0 - pmovmskb %xmm0, %edx - add $16, %esi - test %edx, %edx - jz 1b - -2: - neg %eax - lea -16(%eax, %esi), %eax /* calculate exact offset */ - bsf %edx, %ecx /* Least significant 1 bit is index of null */ - add %ecx, %eax - popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (%esi) - ret - -END (__strlen_sse2) - # undef ENTRY # define ENTRY(name) \ .type __strlen_ia32, @function; \ diff --git a/libc/sysdeps/i386/i686/multiarch/varshift.c b/libc/sysdeps/i386/i686/multiarch/varshift.c new file mode 100644 index 000000000..7760b966e --- /dev/null +++ b/libc/sysdeps/i386/i686/multiarch/varshift.c @@ -0,0 +1 @@ +#include diff --git a/libc/sysdeps/i386/i686/multiarch/varshift.h b/libc/sysdeps/i386/i686/multiarch/varshift.h new file mode 100644 index 000000000..7c72c70d6 --- /dev/null +++ b/libc/sysdeps/i386/i686/multiarch/varshift.h @@ -0,0 +1 @@ +#include diff --git a/libc/sysdeps/powerpc/powerpc64/dl-machine.h b/libc/sysdeps/powerpc/powerpc64/dl-machine.h index 00888587a..901a44e4b 100644 --- a/libc/sysdeps/powerpc/powerpc64/dl-machine.h +++ b/libc/sysdeps/powerpc/powerpc64/dl-machine.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF dynamic relocation inline functions. PowerPC64 version. - Copyright 1995-2005, 2006, 2008 Free Software Foundation, Inc. + Copyright 1995-2005, 2006, 2008, 2010 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 @@ -641,16 +641,14 @@ elf_machine_rela (struct link_map *map, value = elf_machine_tprel (map, sym_map, sym, reloc); if (dont_expect ((value & 3) != 0)) _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS", reloc_addr, refsym); - *(Elf64_Half *) reloc_addr = BIT_INSERT (*(Elf64_Half *) reloc_addr, - value, 0xfffc); + BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc); break; case R_PPC64_TPREL16_DS: value = elf_machine_tprel (map, sym_map, sym, reloc); if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0)) _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr, refsym); - *(Elf64_Half *) reloc_addr = BIT_INSERT (*(Elf64_Half *) reloc_addr, - value, 0xfffc); + BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc); break; case R_PPC64_TPREL16: diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list index 30122853a..aaa355783 100644 --- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list +++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list @@ -8,3 +8,4 @@ oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 readahead - readahead i:iiiii __readahead readahead prlimit64 EXTRA prlimit64 i:iipp prlimit64 +fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sys/epoll.h b/libc/sysdeps/unix/sysv/linux/sparc/sys/epoll.h index cc0ddef69..9943f2138 100644 --- a/libc/sysdeps/unix/sysv/linux/sparc/sys/epoll.h +++ b/libc/sysdeps/unix/sysv/linux/sparc/sys/epoll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2002-2006, 2007, 2008, 2010 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 @@ -31,7 +31,7 @@ typedef __sigset_t sigset_t; #endif -/* Flags to be passed to epoll_create2. */ +/* Flags to be passed to epoll_create1. */ enum { EPOLL_CLOEXEC = 0x400000, @@ -101,8 +101,9 @@ __BEGIN_DECLS returned by epoll_create() should be closed with close(). */ extern int epoll_create (int __size) __THROW; -/* Same as epoll_create but with an additional FLAGS parameter. */ -extern int epoll_create2 (int __size, int __flags) __THROW; +/* Same as epoll_create but with an FLAGS parameter. The unused SIZE + parameter has been dropped. */ +extern int epoll_create1 (int __flags) __THROW; /* Manipulate an epoll instance "epfd". Returns 0 in case of success, diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h b/libc/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h index 234798e4b..d799c845c 100644 --- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h +++ b/libc/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. +/* Copyright (C) 2002-2008, 2010 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 @@ -31,7 +31,7 @@ typedef __sigset_t sigset_t; #endif -/* Flags to be passed to epoll_create2. */ +/* Flags to be passed to epoll_create1. */ enum { EPOLL_CLOEXEC = 02000000, diff --git a/libc/sysdeps/x86_64/add_n.S b/libc/sysdeps/x86_64/add_n.S index 7883f6c84..f0b4c3f78 100644 --- a/libc/sysdeps/x86_64/add_n.S +++ b/libc/sysdeps/x86_64/add_n.S @@ -1,6 +1,6 @@ -/* Add two limb vectors of the same length > 0 and store sum in a third - limb vector. - Copyright (C) 2004 Free Software Foundation, Inc. +/* x86-64 __mpn_add_n -- Add two limb vectors of the same length > 0 and store + sum in a third limb vector. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -21,22 +21,81 @@ #include "sysdep.h" #include "asm-syntax.h" +#define rp %rdi +#define up %rsi +#define vp %rdx +#define n %rcx +#define cy %r8 + +#ifndef func +# define func __mpn_add_n +# define ADCSBB adc +#endif + .text -ENTRY (__mpn_add_n) - leaq (%rsi,%rcx,8), %rsi - leaq (%rdi,%rcx,8), %rdi - leaq (%rdx,%rcx,8), %rdx - negq %rcx - xorl %eax, %eax # clear cy - .p2align 2 -L(loop): - movq (%rsi,%rcx,8), %rax - movq (%rdx,%rcx,8), %r10 - adcq %r10, %rax - movq %rax, (%rdi,%rcx,8) - incq %rcx - jne L(loop) - movq %rcx, %rax # zero %rax - adcq %rax, %rax +ENTRY (func) + xor %r8, %r8 + mov (up), %r10 + mov (vp), %r11 + + lea -8(up,n,8), up + lea -8(vp,n,8), vp + lea -16(rp,n,8), rp + mov %ecx, %eax + neg n + and $3, %eax + je L(b00) + add %rax, n /* clear low rcx bits for jrcxz */ + cmp $2, %eax + jl L(b01) + je L(b10) + +L(b11): shr %r8 /* set cy */ + jmp L(e11) + +L(b00): shr %r8 /* set cy */ + mov %r10, %r8 + mov %r11, %r9 + lea 4(n), n + jmp L(e00) + +L(b01): shr %r8 /* set cy */ + jmp L(e01) + +L(b10): shr %r8 /* set cy */ + mov %r10, %r8 + mov %r11, %r9 + jmp L(e10) + +L(end): ADCSBB %r11, %r10 + mov %r10, 8(rp) + mov %ecx, %eax /* clear eax, ecx contains 0 */ + adc %eax, %eax ret -END (__mpn_add_n) + + .p2align 4 +L(top): + mov -24(up,n,8), %r8 + mov -24(vp,n,8), %r9 + ADCSBB %r11, %r10 + mov %r10, -24(rp,n,8) +L(e00): + mov -16(up,n,8), %r10 + mov -16(vp,n,8), %r11 + ADCSBB %r9, %r8 + mov %r8, -16(rp,n,8) +L(e11): + mov -8(up,n,8), %r8 + mov -8(vp,n,8), %r9 + ADCSBB %r11, %r10 + mov %r10, -8(rp,n,8) +L(e10): + mov (up,n,8), %r10 + mov (vp,n,8), %r11 + ADCSBB %r9, %r8 + mov %r8, (rp,n,8) +L(e01): + jrcxz L(end) + lea 4(n), n + jmp L(top) +END (func) diff --git a/libc/sysdeps/x86_64/addmul_1.S b/libc/sysdeps/x86_64/addmul_1.S index bdb5226a3..e99789670 100644 --- a/libc/sysdeps/x86_64/addmul_1.S +++ b/libc/sysdeps/x86_64/addmul_1.S @@ -1,6 +1,6 @@ -/* AMD64 __mpn_addmul_1 -- Multiply a limb vector with a limb and add +/* x86-64 __mpn_addmul_1 -- Multiply a limb vector with a limb and add the result to a second limb vector. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -21,26 +21,95 @@ #include "sysdep.h" #include "asm-syntax.h" +#define rp %rdi +#define up %rsi +#define n %rdx +#define v0 %rcx + +#ifndef func +# define func __mpn_addmul_1 +# define ADDSUB add +#endif + .text -ENTRY (__mpn_addmul_1) - movq %rdx, %r11 - leaq (%rsi,%rdx,8), %rsi - leaq (%rdi,%rdx,8), %rdi - negq %r11 - xorl %r8d, %r8d - xorl %r10d, %r10d - .p2align 2 -L(loop): - movq (%rsi,%r11,8), %rax - mulq %rcx - addq (%rdi,%r11,8), %rax - adcq %r10, %rdx - addq %r8, %rax - movq %r10, %r8 - movq %rax, (%rdi,%r11,8) - adcq %rdx, %r8 - incq %r11 - jne L(loop) - movq %r8, %rax +ENTRY (func) + push %rbx + push %rbp + lea (%rdx), %rbx + neg %rbx + + mov (up), %rax + mov (rp), %r10 + + lea -16(rp,%rdx,8), rp + lea (up,%rdx,8), up + mul %rcx + + bt $0, %ebx + jc L(odd) + + lea (%rax), %r11 + mov 8(up,%rbx,8), %rax + lea (%rdx), %rbp + mul %rcx + add $2, %rbx + jns L(n2) + + lea (%rax), %r8 + mov (up,%rbx,8), %rax + lea (%rdx), %r9 + jmp L(mid) + +L(odd): add $1, %rbx + jns L(n1) + + lea (%rax), %r8 + mov (up,%rbx,8), %rax + lea (%rdx), %r9 + mul %rcx + lea (%rax), %r11 + mov 8(up,%rbx,8), %rax + lea (%rdx), %rbp + jmp L(e) + + .p2align 4 +L(top): mul %rcx + ADDSUB %r8, %r10 + lea (%rax), %r8 + mov (up,%rbx,8), %rax + adc %r9, %r11 + mov %r10, -8(rp,%rbx,8) + mov (rp,%rbx,8), %r10 + lea (%rdx), %r9 + adc $0, %rbp +L(mid): mul %rcx + ADDSUB %r11, %r10 + lea (%rax), %r11 + mov 8(up,%rbx,8), %rax + adc %rbp, %r8 + mov %r10, (rp,%rbx,8) + mov 8(rp,%rbx,8), %r10 + lea (%rdx), %rbp + adc $0, %r9 +L(e): add $2, %rbx + js L(top) + + mul %rcx + ADDSUB %r8, %r10 + adc %r9, %r11 + mov %r10, -8(rp) + adc $0, %rbp +L(n2): mov (rp), %r10 + ADDSUB %r11, %r10 + adc %rbp, %rax + mov %r10, (rp) + adc $0, %rdx +L(n1): mov 8(rp), %r10 + ADDSUB %rax, %r10 + mov %r10, 8(rp) + mov %ebx, %eax /* zero rax */ + adc %rdx, %rax + pop %rbp + pop %rbx ret -END (__mpn_addmul_1) +END (func) diff --git a/libc/sysdeps/x86_64/lshift.S b/libc/sysdeps/x86_64/lshift.S index 5ac66f0a3..f89d3e09b 100644 --- a/libc/sysdeps/x86_64/lshift.S +++ b/libc/sysdeps/x86_64/lshift.S @@ -1,5 +1,5 @@ -/* AMD64 __mpn_lshift -- - Copyright 2004, 2006 Free Software Foundation, Inc. +/* x86-64 __mpn_lshift -- + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -20,41 +20,98 @@ #include "sysdep.h" #include "asm-syntax.h" +#define rp %rdi +#define up %rsi +#define n %rdx +#define cnt %cl .text ENTRY (__mpn_lshift) - movq -8(%rsi,%rdx,8), %mm7 - movd %ecx, %mm1 - movl $64, %eax - subl %ecx, %eax - movd %eax, %mm0 - movq %mm7, %mm3 - psrlq %mm0, %mm7 - movd %mm7, %rax - subq $2, %rdx - jl L(endo) - .p2align 2 -L(loop): - movq (%rsi,%rdx,8), %mm6 - movq %mm6, %mm2 - psrlq %mm0, %mm6 - psllq %mm1, %mm3 - por %mm6, %mm3 - movq %mm3, 8(%rdi,%rdx,8) - je L(ende) - movq -8(%rsi,%rdx,8), %mm7 - movq %mm7, %mm3 - psrlq %mm0, %mm7 - psllq %mm1, %mm2 - por %mm7, %mm2 - movq %mm2, (%rdi,%rdx,8) - subq $2, %rdx - jge L(loop) -L(endo): - movq %mm3, %mm2 -L(ende): - psllq %mm1, %mm2 - movq %mm2, (%rdi) - emms + lea -8(rp,n,8), rp + lea -8(up,n,8), up + + mov %edx, %eax + and $3, %eax + jne L(nb00) +L(b00): /* n = 4, 8, 12, ... */ + mov (up), %r10 + mov -8(up), %r11 + xor %eax, %eax + shld %cl, %r10, %rax + mov -16(up), %r8 + lea 24(rp), rp + sub $4, n + jmp L(00) + +L(nb00):/* n = 1, 5, 9, ... */ + cmp $2, %eax + jae L(nb01) +L(b01): mov (up), %r9 + xor %eax, %eax + shld %cl, %r9, %rax + sub $2, n + jb L(le1) + mov -8(up), %r10 + mov -16(up), %r11 + lea -8(up), up + lea 16(rp), rp + jmp L(01) +L(le1): shl %cl, %r9 + mov %r9, (rp) + ret + +L(nb01):/* n = 2, 6, 10, ... */ + jne L(b11) +L(b10): mov (up), %r8 + mov -8(up), %r9 + xor %eax, %eax + shld %cl, %r8, %rax + sub $3, n + jb L(le2) + mov -16(up), %r10 + lea -16(up), up + lea 8(rp), rp + jmp L(10) +L(le2): shld %cl, %r9, %r8 + mov %r8, (rp) + shl %cl, %r9 + mov %r9, -8(rp) + ret + + .p2align 4 /* performance critical! */ +L(b11): /* n = 3, 7, 11, ... */ + mov (up), %r11 + mov -8(up), %r8 + xor %eax, %eax + shld %cl, %r11, %rax + mov -16(up), %r9 + lea -24(up), up + sub $4, n + jb L(end) + + .p2align 4 +L(top): shld %cl, %r8, %r11 + mov (up), %r10 + mov %r11, (rp) +L(10): shld %cl, %r9, %r8 + mov -8(up), %r11 + mov %r8, -8(rp) +L(01): shld %cl, %r10, %r9 + mov -16(up), %r8 + mov %r9, -16(rp) +L(00): shld %cl, %r11, %r10 + mov -24(up), %r9 + mov %r10, -24(rp) + add $-32, up + lea -32(rp), rp + sub $4, n + jnc L(top) + +L(end): shld %cl, %r8, %r11 + mov %r11, (rp) + shld %cl, %r9, %r8 + mov %r8, -8(rp) + shl %cl, %r9 + mov %r9, -16(rp) ret END (__mpn_lshift) diff --git a/libc/sysdeps/x86_64/mul_1.S b/libc/sysdeps/x86_64/mul_1.S index 978916b72..676afd175 100644 --- a/libc/sysdeps/x86_64/mul_1.S +++ b/libc/sysdeps/x86_64/mul_1.S @@ -1,6 +1,6 @@ /* AMD64 __mpn_mul_1 -- Multiply a limb vector with a limb and store the result in a second limb vector. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -21,22 +21,109 @@ #include #include "asm-syntax.h" +#define rp %rdi +#define up %rsi +#define n_param %rdx +#define vl %rcx + +#define n %r11 + .text ENTRY (__mpn_mul_1) - movq %rdx, %r11 - leaq (%rsi,%rdx,8), %rsi - leaq (%rdi,%rdx,8), %rdi - negq %r11 - xorl %r8d, %r8d -L(loop): - movq (%rsi,%r11,8), %rax - mulq %rcx - addq %r8, %rax - movl $0, %r8d - adcq %rdx, %r8 - movq %rax, (%rdi,%r11,8) - incq %r11 - jne L(loop) - movq %r8, %rax + push %rbx + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbx, 0) + xor %r10, %r10 + mov (up), %rax /* read first u limb early */ + mov n_param, %rbx /* move away n from rdx, mul uses it */ + mul vl + mov %rbx, %r11 + + add %r10, %rax + adc $0, %rdx + + and $3, %ebx + jz L(b0) + cmp $2, %ebx + jz L(b2) + jg L(b3) + +L(b1): dec n + jne L(gt1) + mov %rax, (rp) + jmp L(ret) +L(gt1): lea 8(up,n,8), up + lea -8(rp,n,8), rp + neg n + xor %r10, %r10 + xor %ebx, %ebx + mov %rax, %r9 + mov (up,n,8), %rax + mov %rdx, %r8 + jmp L(L1) + +L(b0): lea (up,n,8), up + lea -16(rp,n,8), rp + neg n + xor %r10, %r10 + mov %rax, %r8 + mov %rdx, %rbx + jmp L(L0) + +L(b3): lea -8(up,n,8), up + lea -24(rp,n,8), rp + neg n + mov %rax, %rbx + mov %rdx, %r10 + jmp L(L3) + +L(b2): lea -16(up,n,8), up + lea -32(rp,n,8), rp + neg n + xor %r8, %r8 + xor %ebx, %ebx + mov %rax, %r10 + mov 24(up,n,8), %rax + mov %rdx, %r9 + jmp L(L2) + + .p2align 4 +L(top): mov %r10, (rp,n,8) + add %rax, %r9 + mov (up,n,8), %rax + adc %rdx, %r8 + mov $0, %r10d +L(L1): mul vl + mov %r9, 8(rp,n,8) + add %rax, %r8 + adc %rdx, %rbx +L(L0): mov 8(up,n,8), %rax + mul vl + mov %r8, 16(rp,n,8) + add %rax, %rbx + adc %rdx, %r10 +L(L3): mov 16(up,n,8), %rax + mul vl + mov %rbx, 24(rp,n,8) + mov $0, %r8d # zero + mov %r8, %rbx # zero + add %rax, %r10 + mov 24(up,n,8), %rax + mov %r8, %r9 # zero + adc %rdx, %r9 +L(L2): mul vl + add $4, n + js L(top) + + mov %r10, (rp,n,8) + add %rax, %r9 + adc %r8, %rdx + mov %r9, 8(rp,n,8) + add %r8, %rdx +L(ret): mov %rdx, %rax + + pop %rbx + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbx) ret END (__mpn_mul_1) diff --git a/libc/sysdeps/x86_64/multiarch/Makefile b/libc/sysdeps/x86_64/multiarch/Makefile index b124524b2..5d2e34ebc 100644 --- a/libc/sysdeps/x86_64/multiarch/Makefile +++ b/libc/sysdeps/x86_64/multiarch/Makefile @@ -8,9 +8,10 @@ sysdep_routines += stpncpy-c strncpy-c strcmp-ssse3 strncmp-ssse3 \ strend-sse4 memcmp-sse4 memcpy-ssse3 mempcpy-ssse3 \ memmove-ssse3 memcpy-ssse3-back mempcpy-ssse3-back \ memmove-ssse3-back strcasestr-nonascii strcasecmp_l-ssse3 \ - strncase_l-ssse3 + strncase_l-ssse3 strlen-sse4 strlen-no-bsf ifeq (yes,$(config-cflags-sse4)) -sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c +sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c varshift +CFLAGS-varshift.c += -msse4 CFLAGS-strcspn-c.c += -msse4 CFLAGS-strpbrk-c.c += -msse4 CFLAGS-strspn-c.c += -msse4 diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.c b/libc/sysdeps/x86_64/multiarch/init-arch.c index 55c9f54f9..786466d5f 100644 --- a/libc/sysdeps/x86_64/multiarch/init-arch.c +++ b/libc/sysdeps/x86_64/multiarch/init-arch.c @@ -72,6 +72,12 @@ __init_cpu_features (void) model += extended_model; switch (model) { + case 0x1c: + case 0x26: + /* BSF is slow on Atom. */ + __cpu_features.feature[index_Slow_BSF] |= bit_Slow_BSF; + break; + case 0x1a: case 0x1e: case 0x1f: diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.h b/libc/sysdeps/x86_64/multiarch/init-arch.h index 4a211c086..783b02015 100644 --- a/libc/sysdeps/x86_64/multiarch/init-arch.h +++ b/libc/sysdeps/x86_64/multiarch/init-arch.h @@ -18,6 +18,7 @@ #define bit_Fast_Rep_String (1 << 0) #define bit_Fast_Copy_Backward (1 << 1) +#define bit_Slow_BSF (1 << 2) #ifdef __ASSEMBLER__ @@ -35,6 +36,7 @@ # define index_Fast_Rep_String FEATURE_INDEX_1*FEATURE_SIZE # define index_Fast_Copy_Backward FEATURE_INDEX_1*FEATURE_SIZE +# define index_Slow_BSF FEATURE_INDEX_1*FEATURE_SIZE #else /* __ASSEMBLER__ */ @@ -106,6 +108,7 @@ extern const struct cpu_features *__get_cpu_features (void) # define index_Fast_Rep_String FEATURE_INDEX_1 # define index_Fast_Copy_Backward FEATURE_INDEX_1 +# define index_Slow_BSF FEATURE_INDEX_1 #define HAS_ARCH_FEATURE(idx, bit) \ ((__get_cpu_features ()->feature[idx] & (bit)) != 0) @@ -116,4 +119,7 @@ extern const struct cpu_features *__get_cpu_features (void) #define HAS_FAST_COPY_BACKWARD \ HAS_ARCH_FEATURE (index_Fast_Copy_Backward, bit_Fast_Copy_Backward) +#define HAS_SLOW_BSF \ + HAS_ARCH_FEATURE (index_Slow_BSF, bit_Slow_BSF) + #endif /* __ASSEMBLER__ */ diff --git a/libc/sysdeps/x86_64/multiarch/memmove.c b/libc/sysdeps/x86_64/multiarch/memmove.c index bbe96273b..379862722 100644 --- a/libc/sysdeps/x86_64/multiarch/memmove.c +++ b/libc/sysdeps/x86_64/multiarch/memmove.c @@ -1,3 +1,24 @@ +/* Multiple versions of memmove. + Copyright (C) 2010 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 + #ifndef NOT_IN_libc #include "init-arch.h" @@ -9,13 +30,13 @@ #endif #endif +extern __typeof (memmove) __memmove_sse2 attribute_hidden; +extern __typeof (memmove) __memmove_ssse3 attribute_hidden; +extern __typeof (memmove) __memmove_ssse3_back attribute_hidden; + #include "string/memmove.c" #ifndef NOT_IN_libc -extern __typeof (__memmove_sse2) __memmove_sse2 attribute_hidden; -extern __typeof (__memmove_sse2) __memmove_ssse3 attribute_hidden; -extern __typeof (__memmove_sse2) __memmove_ssse3_back attribute_hidden; - libc_ifunc (memmove, HAS_SSSE3 ? (HAS_FAST_COPY_BACKWARD diff --git a/libc/sysdeps/x86_64/multiarch/memmove_chk.c b/libc/sysdeps/x86_64/multiarch/memmove_chk.c index a474f5f5e..962501d45 100644 --- a/libc/sysdeps/x86_64/multiarch/memmove_chk.c +++ b/libc/sysdeps/x86_64/multiarch/memmove_chk.c @@ -1,12 +1,32 @@ +/* Multiple versions of __memmove_chk. + Copyright (C) 2010 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 #include "init-arch.h" #define MEMMOVE_CHK __memmove_chk_sse2 -#include "debug/memmove_chk.c" +extern __typeof (__memmove_chk) __memmove_chk_sse2 attribute_hidden; +extern __typeof (__memmove_chk) __memmove_chk_ssse3 attribute_hidden; +extern __typeof (__memmove_chk) __memmove_chk_ssse3_back attribute_hidden; -extern __typeof (__memmove_chk_sse2) __memmove_chk_sse2 attribute_hidden; -extern __typeof (__memmove_chk_sse2) __memmove_chk_ssse3 attribute_hidden; -extern __typeof (__memmove_chk_sse2) __memmove_chk_ssse3_back attribute_hidden; +#include "debug/memmove_chk.c" libc_ifunc (__memmove_chk, HAS_SSSE3 diff --git a/libc/sysdeps/x86_64/multiarch/strcspn-c.c b/libc/sysdeps/x86_64/multiarch/strcspn-c.c index daeebe1bf..0b2ce7692 100644 --- a/libc/sysdeps/x86_64/multiarch/strcspn-c.c +++ b/libc/sysdeps/x86_64/multiarch/strcspn-c.c @@ -1,5 +1,5 @@ /* strcspn with SSE4.2 intrinsics - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Intel Corporation. This file is part of the GNU C Library. @@ -20,6 +20,7 @@ #include #include +#include "varshift.h" /* We use 0x2: _SIDD_SBYTE_OPS @@ -86,8 +87,6 @@ STRCSPN_SSE42 (const char *s, const char *a) const char *aligned; __m128i mask; - /* Fake initialization. gcc otherwise will warn. */ - asm ("" : "=xm" (mask)); int offset = (int) ((size_t) a & 15); if (offset != 0) { @@ -95,54 +94,7 @@ STRCSPN_SSE42 (const char *s, const char *a) aligned = (const char *) ((size_t) a & -16L); __m128i mask0 = _mm_load_si128 ((__m128i *) aligned); - switch (offset) - { - case 1: - mask = _mm_srli_si128 (mask0, 1); - break; - case 2: - mask = _mm_srli_si128 (mask0, 2); - break; - case 3: - mask = _mm_srli_si128 (mask0, 3); - break; - case 4: - mask = _mm_srli_si128 (mask0, 4); - break; - case 5: - mask = _mm_srli_si128 (mask0, 5); - break; - case 6: - mask = _mm_srli_si128 (mask0, 6); - break; - case 7: - mask = _mm_srli_si128 (mask0, 7); - break; - case 8: - mask = _mm_srli_si128 (mask0, 8); - break; - case 9: - mask = _mm_srli_si128 (mask0, 9); - break; - case 10: - mask = _mm_srli_si128 (mask0, 10); - break; - case 11: - mask = _mm_srli_si128 (mask0, 11); - break; - case 12: - mask = _mm_srli_si128 (mask0, 12); - break; - case 13: - mask = _mm_srli_si128 (mask0, 13); - break; - case 14: - mask = _mm_srli_si128 (mask0, 14); - break; - case 15: - mask = _mm_srli_si128 (mask0, 15); - break; - } + mask = __m128i_shift_right (mask0, offset); /* Find where the NULL terminator is. */ int length = _mm_cmpistri (mask, mask, 0x3a); @@ -159,55 +111,10 @@ STRCSPN_SSE42 (const char *s, const char *a) if (index != 0) { - /* Combine mask0 and mask1. */ - switch (offset) - { - case 1: - mask = _mm_alignr_epi8 (mask1, mask0, 1); - break; - case 2: - mask = _mm_alignr_epi8 (mask1, mask0, 2); - break; - case 3: - mask = _mm_alignr_epi8 (mask1, mask0, 3); - break; - case 4: - mask = _mm_alignr_epi8 (mask1, mask0, 4); - break; - case 5: - mask = _mm_alignr_epi8 (mask1, mask0, 5); - break; - case 6: - mask = _mm_alignr_epi8 (mask1, mask0, 6); - break; - case 7: - mask = _mm_alignr_epi8 (mask1, mask0, 7); - break; - case 8: - mask = _mm_alignr_epi8 (mask1, mask0, 8); - break; - case 9: - mask = _mm_alignr_epi8 (mask1, mask0, 9); - break; - case 10: - mask = _mm_alignr_epi8 (mask1, mask0, 10); - break; - case 11: - mask = _mm_alignr_epi8 (mask1, mask0, 11); - break; - case 12: - mask = _mm_alignr_epi8 (mask1, mask0, 12); - break; - case 13: - mask = _mm_alignr_epi8 (mask1, mask0, 13); - break; - case 14: - mask = _mm_alignr_epi8 (mask1, mask0, 14); - break; - case 15: - mask = _mm_alignr_epi8 (mask1, mask0, 15); - break; - } + /* Combine mask0 and mask1. We could play games with + palignr, but frankly this data should be in L1 now + so do the merge via an unaligned load. */ + mask = _mm_loadu_si128 ((__m128i *) a); } } } @@ -234,54 +141,7 @@ STRCSPN_SSE42 (const char *s, const char *a) aligned = (const char *) ((size_t) s & -16L); __m128i value = _mm_load_si128 ((__m128i *) aligned); - switch (offset) - { - case 1: - value = _mm_srli_si128 (value, 1); - break; - case 2: - value = _mm_srli_si128 (value, 2); - break; - case 3: - value = _mm_srli_si128 (value, 3); - break; - case 4: - value = _mm_srli_si128 (value, 4); - break; - case 5: - value = _mm_srli_si128 (value, 5); - break; - case 6: - value = _mm_srli_si128 (value, 6); - break; - case 7: - value = _mm_srli_si128 (value, 7); - break; - case 8: - value = _mm_srli_si128 (value, 8); - break; - case 9: - value = _mm_srli_si128 (value, 9); - break; - case 10: - value = _mm_srli_si128 (value, 10); - break; - case 11: - value = _mm_srli_si128 (value, 11); - break; - case 12: - value = _mm_srli_si128 (value, 12); - break; - case 13: - value = _mm_srli_si128 (value, 13); - break; - case 14: - value = _mm_srli_si128 (value, 14); - break; - case 15: - value = _mm_srli_si128 (value, 15); - break; - } + value = __m128i_shift_right (value, offset); int length = _mm_cmpistri (mask, value, 0x2); /* No need to check ZFlag since ZFlag is always 1. */ diff --git a/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S b/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S new file mode 100644 index 000000000..3e52f8165 --- /dev/null +++ b/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S @@ -0,0 +1,309 @@ +/* strlen without BSF + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Intel Corporation. + 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. */ + +#if defined SHARED && !defined NOT_IN_libc + +#include + + .section .text.slow,"ax",@progbits +ENTRY (__strlen_no_bsf) + xor %eax, %eax + cmpb $0, (%rdi) + jz L(exit_tail0) + cmpb $0, 1(%rdi) + jz L(exit_tail1) + cmpb $0, 2(%rdi) + jz L(exit_tail2) + cmpb $0, 3(%rdi) + jz L(exit_tail3) + cmpb $0, 4(%rdi) + jz L(exit_tail4) + cmpb $0, 5(%rdi) + jz L(exit_tail5) + cmpb $0, 6(%rdi) + jz L(exit_tail6) + cmpb $0, 7(%rdi) + jz L(exit_tail7) + cmpb $0, 8(%rdi) + jz L(exit_tail8) + cmpb $0, 9(%rdi) + jz L(exit_tail9) + cmpb $0, 10(%rdi) + jz L(exit_tail10) + cmpb $0, 11(%rdi) + jz L(exit_tail11) + cmpb $0, 12(%rdi) + jz L(exit_tail12) + cmpb $0, 13(%rdi) + jz L(exit_tail13) + cmpb $0, 14(%rdi) + jz L(exit_tail14) + cmpb $0, 15(%rdi) + jz L(exit_tail15) + pxor %xmm0, %xmm0 + mov %rdi, %rcx + mov %rdi, %rax + and $-16, %rax + add $16, %rax + add $16, %rcx + + pcmpeqb (%rax), %xmm0 + pmovmskb %xmm0, %edx + pxor %xmm1, %xmm1 + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm1 + pmovmskb %xmm1, %edx + pxor %xmm2, %xmm2 + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + + pcmpeqb (%rax), %xmm2 + pmovmskb %xmm2, %edx + pxor %xmm3, %xmm3 + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + pcmpeqb (%rax), %xmm3 + pmovmskb %xmm3, %edx + test %edx, %edx + lea 16(%rax), %rax + jnz L(exit) + + and $-0x40, %rax + xor %r8d, %r8d +L(aligned_64): + pcmpeqb (%rax), %xmm0 + pcmpeqb 16(%rax), %xmm1 + pcmpeqb 32(%rax), %xmm2 + pcmpeqb 48(%rax), %xmm3 + pmovmskb %xmm0, %edx + pmovmskb %xmm1, %esi + pmovmskb %xmm2, %edi + pmovmskb %xmm3, %r9d + or %edx, %r8d + or %esi, %r8d + or %edi, %r8d + or %r9d, %r8d + lea 64(%rax), %rax + jz L(aligned_64) + + test %edx, %edx + jnz L(aligned_64_exit_16) + test %esi, %esi + jnz L(aligned_64_exit_32) + test %edi, %edi + jnz L(aligned_64_exit_48) +L(aligned_64_exit_64): + mov %r9d, %edx + jmp L(aligned_64_exit) +L(aligned_64_exit_48): + lea -16(%rax), %rax + mov %edi, %edx + jmp L(aligned_64_exit) +L(aligned_64_exit_32): + lea -32(%rax), %rax + mov %esi, %edx + jmp L(aligned_64_exit) +L(aligned_64_exit_16): + lea -48(%rax), %rax +L(aligned_64_exit): +L(exit): + sub %rcx, %rax + test %dl, %dl + jz L(exit_high) + test $0x01, %dl + jnz L(exit_tail0) + + test $0x02, %dl + jnz L(exit_tail1) + + test $0x04, %dl + jnz L(exit_tail2) + + test $0x08, %dl + jnz L(exit_tail3) + + test $0x10, %dl + jnz L(exit_tail4) + + test $0x20, %dl + jnz L(exit_tail5) + + test $0x40, %dl + jnz L(exit_tail6) + add $7, %eax +L(exit_tail0): + ret + +L(exit_high): + add $8, %eax + test $0x01, %dh + jnz L(exit_tail0) + + test $0x02, %dh + jnz L(exit_tail1) + + test $0x04, %dh + jnz L(exit_tail2) + + test $0x08, %dh + jnz L(exit_tail3) + + test $0x10, %dh + jnz L(exit_tail4) + + test $0x20, %dh + jnz L(exit_tail5) + + test $0x40, %dh + jnz L(exit_tail6) + add $7, %eax + ret + .p2align 4 +L(exit_tail1): + add $1, %eax + ret + +L(exit_tail2): + add $2, %eax + ret + +L(exit_tail3): + add $3, %eax + ret + +L(exit_tail4): + add $4, %eax + ret + +L(exit_tail5): + add $5, %eax + ret +L(exit_tail6): + add $6, %eax + ret +L(exit_tail7): + add $7, %eax + ret +L(exit_tail8): + add $8, %eax + ret +L(exit_tail9): + add $9, %eax + ret +L(exit_tail10): + add $10, %eax + ret +L(exit_tail11): + add $11, %eax + ret +L(exit_tail12): + add $12, %eax + ret +L(exit_tail13): + add $13, %eax + ret +L(exit_tail14): + add $14, %eax + ret +L(exit_tail15): + add $15, %eax + ret +END (__strlen_no_bsf) + +#endif diff --git a/libc/sysdeps/x86_64/multiarch/strlen-sse4.S b/libc/sysdeps/x86_64/multiarch/strlen-sse4.S new file mode 100644 index 000000000..6b16ea7fa --- /dev/null +++ b/libc/sysdeps/x86_64/multiarch/strlen-sse4.S @@ -0,0 +1,85 @@ +/* strlen with SSE4 + Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Contributed by Ulrich Drepper . + 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. */ + +#if defined SHARED && !defined NOT_IN_libc + +#include + + .section .text.sse4.2,"ax",@progbits +ENTRY (__strlen_sse42) + pxor %xmm1, %xmm1 + movl %edi, %ecx + movq %rdi, %r8 + andq $~15, %rdi + xor %edi, %ecx + pcmpeqb (%rdi), %xmm1 + pmovmskb %xmm1, %edx + shrl %cl, %edx + shll %cl, %edx + andl %edx, %edx + jnz L(less16bytes) + pxor %xmm1, %xmm1 + + .p2align 4 +L(more64bytes_loop): + pcmpistri $0x08, 16(%rdi), %xmm1 + jz L(more32bytes) + + pcmpistri $0x08, 32(%rdi), %xmm1 + jz L(more48bytes) + + pcmpistri $0x08, 48(%rdi), %xmm1 + jz L(more64bytes) + + add $64, %rdi + pcmpistri $0x08, (%rdi), %xmm1 + jnz L(more64bytes_loop) + leaq (%rdi,%rcx), %rax + subq %r8, %rax + ret + + .p2align 4 +L(more32bytes): + leaq 16(%rdi,%rcx, 1), %rax + subq %r8, %rax + ret + + .p2align 4 +L(more48bytes): + leaq 32(%rdi,%rcx, 1), %rax + subq %r8, %rax + ret + + .p2align 4 +L(more64bytes): + leaq 48(%rdi,%rcx, 1), %rax + subq %r8, %rax + ret + + .p2align 4 +L(less16bytes): + subq %r8, %rdi + bsfl %edx, %eax + addq %rdi, %rax + ret + +END (__strlen_sse42) + +#endif diff --git a/libc/sysdeps/x86_64/multiarch/strlen.S b/libc/sysdeps/x86_64/multiarch/strlen.S index f9641131f..83a88ecd9 100644 --- a/libc/sysdeps/x86_64/multiarch/strlen.S +++ b/libc/sysdeps/x86_64/multiarch/strlen.S @@ -1,5 +1,5 @@ /* strlen(str) -- determine the length of the string STR. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Ulrich Drepper . This file is part of the GNU C Library. @@ -36,74 +36,12 @@ ENTRY(strlen) testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq __strlen_sse42(%rip), %rax -2: ret -END(strlen) - - - .section .text.sse4.2,"ax",@progbits - .align 16 - .type __strlen_sse42, @function -__strlen_sse42: - cfi_startproc - CALL_MCOUNT - pxor %xmm1, %xmm1 - movl %edi, %ecx - movq %rdi, %r8 - andq $~15, %rdi - xor %edi, %ecx - pcmpeqb (%rdi), %xmm1 - pmovmskb %xmm1, %edx - shrl %cl, %edx - shll %cl, %edx - andl %edx, %edx - jnz L(less16bytes) - pxor %xmm1, %xmm1 - - .p2align 4 -L(more64bytes_loop): - pcmpistri $0x08, 16(%rdi), %xmm1 - jz L(more32bytes) - - pcmpistri $0x08, 32(%rdi), %xmm1 - jz L(more48bytes) - - pcmpistri $0x08, 48(%rdi), %xmm1 - jz L(more64bytes) - - add $64, %rdi - pcmpistri $0x08, (%rdi), %xmm1 - jnz L(more64bytes_loop) - leaq (%rdi,%rcx), %rax - subq %r8, %rax - ret - - .p2align 4 -L(more32bytes): - leaq 16(%rdi,%rcx, 1), %rax - subq %r8, %rax - ret - - .p2align 4 -L(more48bytes): - leaq 32(%rdi,%rcx, 1), %rax - subq %r8, %rax - ret - - .p2align 4 -L(more64bytes): - leaq 48(%rdi,%rcx, 1), %rax - subq %r8, %rax ret - - .p2align 4 -L(less16bytes): - subq %r8, %rdi - bsfl %edx, %eax - addq %rdi, %rax - ret - cfi_endproc - .size __strlen_sse42, .-__strlen_sse42 - +2: testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip) + jz 3f + leaq __strlen_no_bsf(%rip), %rax +3: ret +END(strlen) # undef ENTRY # define ENTRY(name) \ diff --git a/libc/sysdeps/x86_64/multiarch/strspn-c.c b/libc/sysdeps/x86_64/multiarch/strspn-c.c index be9e8ac0a..6faa259fd 100644 --- a/libc/sysdeps/x86_64/multiarch/strspn-c.c +++ b/libc/sysdeps/x86_64/multiarch/strspn-c.c @@ -1,5 +1,5 @@ /* strspn with SSE4.2 intrinsics - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Intel Corporation. This file is part of the GNU C Library. @@ -20,6 +20,7 @@ #include #include +#include "varshift.h" /* We use 0x12: _SIDD_SBYTE_OPS @@ -71,54 +72,7 @@ __strspn_sse42 (const char *s, const char *a) aligned = (const char *) ((size_t) a & -16L); __m128i mask0 = _mm_load_si128 ((__m128i *) aligned); - switch (offset) - { - case 1: - mask = _mm_srli_si128 (mask0, 1); - break; - case 2: - mask = _mm_srli_si128 (mask0, 2); - break; - case 3: - mask = _mm_srli_si128 (mask0, 3); - break; - case 4: - mask = _mm_srli_si128 (mask0, 4); - break; - case 5: - mask = _mm_srli_si128 (mask0, 5); - break; - case 6: - mask = _mm_srli_si128 (mask0, 6); - break; - case 7: - mask = _mm_srli_si128 (mask0, 7); - break; - case 8: - mask = _mm_srli_si128 (mask0, 8); - break; - case 9: - mask = _mm_srli_si128 (mask0, 9); - break; - case 10: - mask = _mm_srli_si128 (mask0, 10); - break; - case 11: - mask = _mm_srli_si128 (mask0, 11); - break; - case 12: - mask = _mm_srli_si128 (mask0, 12); - break; - case 13: - mask = _mm_srli_si128 (mask0, 13); - break; - case 14: - mask = _mm_srli_si128 (mask0, 14); - break; - case 15: - mask = _mm_srli_si128 (mask0, 15); - break; - } + mask = __m128i_shift_right (mask0, offset); /* Find where the NULL terminator is. */ int length = _mm_cmpistri (mask, mask, 0x3a); @@ -135,55 +89,10 @@ __strspn_sse42 (const char *s, const char *a) if (index != 0) { - /* Combine mask0 and mask1. */ - switch (offset) - { - case 1: - mask = _mm_alignr_epi8 (mask1, mask0, 1); - break; - case 2: - mask = _mm_alignr_epi8 (mask1, mask0, 2); - break; - case 3: - mask = _mm_alignr_epi8 (mask1, mask0, 3); - break; - case 4: - mask = _mm_alignr_epi8 (mask1, mask0, 4); - break; - case 5: - mask = _mm_alignr_epi8 (mask1, mask0, 5); - break; - case 6: - mask = _mm_alignr_epi8 (mask1, mask0, 6); - break; - case 7: - mask = _mm_alignr_epi8 (mask1, mask0, 7); - break; - case 8: - mask = _mm_alignr_epi8 (mask1, mask0, 8); - break; - case 9: - mask = _mm_alignr_epi8 (mask1, mask0, 9); - break; - case 10: - mask = _mm_alignr_epi8 (mask1, mask0, 10); - break; - case 11: - mask = _mm_alignr_epi8 (mask1, mask0, 11); - break; - case 12: - mask = _mm_alignr_epi8 (mask1, mask0, 12); - break; - case 13: - mask = _mm_alignr_epi8 (mask1, mask0, 13); - break; - case 14: - mask = _mm_alignr_epi8 (mask1, mask0, 14); - break; - case 15: - mask = _mm_alignr_epi8 (mask1, mask0, 15); - break; - } + /* Combine mask0 and mask1. We could play games with + palignr, but frankly this data should be in L1 now + so do the merge via an unaligned load. */ + mask = _mm_loadu_si128 ((__m128i *) a); } } } @@ -210,54 +119,7 @@ __strspn_sse42 (const char *s, const char *a) aligned = (const char *) ((size_t) s & -16L); __m128i value = _mm_load_si128 ((__m128i *) aligned); - switch (offset) - { - case 1: - value = _mm_srli_si128 (value, 1); - break; - case 2: - value = _mm_srli_si128 (value, 2); - break; - case 3: - value = _mm_srli_si128 (value, 3); - break; - case 4: - value = _mm_srli_si128 (value, 4); - break; - case 5: - value = _mm_srli_si128 (value, 5); - break; - case 6: - value = _mm_srli_si128 (value, 6); - break; - case 7: - value = _mm_srli_si128 (value, 7); - break; - case 8: - value = _mm_srli_si128 (value, 8); - break; - case 9: - value = _mm_srli_si128 (value, 9); - break; - case 10: - value = _mm_srli_si128 (value, 10); - break; - case 11: - value = _mm_srli_si128 (value, 11); - break; - case 12: - value = _mm_srli_si128 (value, 12); - break; - case 13: - value = _mm_srli_si128 (value, 13); - break; - case 14: - value = _mm_srli_si128 (value, 14); - break; - case 15: - value = _mm_srli_si128 (value, 15); - break; - } + value = __m128i_shift_right (value, offset); int length = _mm_cmpistri (mask, value, 0x12); /* No need to check CFlag since it is always 1. */ diff --git a/libc/sysdeps/x86_64/multiarch/strstr.c b/libc/sysdeps/x86_64/multiarch/strstr.c index 45d7a550a..b408b752f 100644 --- a/libc/sysdeps/x86_64/multiarch/strstr.c +++ b/libc/sysdeps/x86_64/multiarch/strstr.c @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include +#include "varshift.h" #ifndef STRSTR_SSE42 # define STRSTR_SSE42 __strstr_sse42 @@ -82,67 +83,6 @@ 5. failed string compare, go back to scanning */ -/* Fix-up of removal of unneeded data due to 16B aligned load - parameters: - value: 16B data loaded from 16B aligned address. - offset: Offset of target data address relative to 16B aligned load - address. - */ - -static __inline__ __m128i -__m128i_shift_right (__m128i value, int offset) -{ - switch (offset) - { - case 1: - value = _mm_srli_si128 (value, 1); - break; - case 2: - value = _mm_srli_si128 (value, 2); - break; - case 3: - value = _mm_srli_si128 (value, 3); - break; - case 4: - value = _mm_srli_si128 (value, 4); - break; - case 5: - value = _mm_srli_si128 (value, 5); - break; - case 6: - value = _mm_srli_si128 (value, 6); - break; - case 7: - value = _mm_srli_si128 (value, 7); - break; - case 8: - value = _mm_srli_si128 (value, 8); - break; - case 9: - value = _mm_srli_si128 (value, 9); - break; - case 10: - value = _mm_srli_si128 (value, 10); - break; - case 11: - value = _mm_srli_si128 (value, 11); - break; - case 12: - value = _mm_srli_si128 (value, 12); - break; - case 13: - value = _mm_srli_si128 (value, 13); - break; - case 14: - value = _mm_srli_si128 (value, 14); - break; - case 15: - value = _mm_srli_si128 (value, 15); - break; - } - return value; -} - /* Simple replacement of movdqu to address 4KB boundary cross issue. If EOS occurs within less than 16B before 4KB boundary, we don't cross to next page. */ diff --git a/libc/sysdeps/x86_64/multiarch/varshift.c b/libc/sysdeps/x86_64/multiarch/varshift.c new file mode 100644 index 000000000..46d72fe3d --- /dev/null +++ b/libc/sysdeps/x86_64/multiarch/varshift.c @@ -0,0 +1,26 @@ +/* Helper for variable shifts of SSE registers. + Copyright (C) 2010 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 "varshift.h" + +const int8_t ___m128i_shift_right[31] attribute_hidden = + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + }; diff --git a/libc/sysdeps/x86_64/multiarch/varshift.h b/libc/sysdeps/x86_64/multiarch/varshift.h new file mode 100644 index 000000000..9554f2ddf --- /dev/null +++ b/libc/sysdeps/x86_64/multiarch/varshift.h @@ -0,0 +1,31 @@ +/* Helper for variable shifts of SSE registers. + Copyright (C) 2010 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 +#include + +extern const int8_t ___m128i_shift_right[31] attribute_hidden; + +static __inline__ __m128i +__m128i_shift_right (__m128i value, unsigned long int offset) +{ + return _mm_shuffle_epi8 (value, + _mm_loadu_si128 ((__m128i *) (___m128i_shift_right + + offset))); +} diff --git a/libc/sysdeps/x86_64/rshift.S b/libc/sysdeps/x86_64/rshift.S index ee0c8aa15..8ff055169 100644 --- a/libc/sysdeps/x86_64/rshift.S +++ b/libc/sysdeps/x86_64/rshift.S @@ -1,5 +1,5 @@ -/* AMD64 __mpn_rshift -- - Copyright (C) 2004, 2006 Free Software Foundation, Inc. +/* x86-64 __mpn_rshift -- + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -20,43 +20,96 @@ #include "sysdep.h" #include "asm-syntax.h" +#define rp %rdi +#define up %rsi +#define n %rdx +#define cnt %cl + .text ENTRY (__mpn_rshift) - movq (%rsi), %mm7 - movd %ecx, %mm1 - movl $64, %eax - subl %ecx, %eax - movd %eax, %mm0 - movq %mm7, %mm3 - psllq %mm0, %mm7 - movd %mm7, %rax - leaq (%rsi,%rdx,8), %rsi - leaq (%rdi,%rdx,8), %rdi - negq %rdx - addq $2, %rdx - jg L(endo) - .p2align 2 -L(loop): - movq -8(%rsi,%rdx,8), %mm6 - movq %mm6, %mm2 - psllq %mm0, %mm6 - psrlq %mm1, %mm3 - por %mm6, %mm3 - movq %mm3, -16(%rdi,%rdx,8) - je L(ende) - movq (%rsi,%rdx,8), %mm7 - movq %mm7, %mm3 - psllq %mm0, %mm7 - psrlq %mm1, %mm2 - por %mm7, %mm2 - movq %mm2, -8(%rdi,%rdx,8) - addq $2, %rdx - jle L(loop) -L(endo): - movq %mm3, %mm2 -L(ende): - psrlq %mm1, %mm2 - movq %mm2, -8(%rdi) - emms + mov %edx, %eax + and $3, %eax + jne L(nb00) +L(b00): /* n = 4, 8, 12, ... */ + mov (up), %r10 + mov 8(up), %r11 + xor %eax, %eax + shrd %cl, %r10, %rax + mov 16(up), %r8 + lea 8(up), up + lea -24(rp), rp + sub $4, n + jmp L(00) + +L(nb00):/* n = 1, 5, 9, ... */ + cmp $2, %eax + jae L(nb01) +L(b01): mov (up), %r9 + xor %eax, %eax + shrd %cl, %r9, %rax + sub $2, n + jb L(le1) + mov 8(up), %r10 + mov 16(up), %r11 + lea 16(up), up + lea -16(rp), rp + jmp L(01) +L(le1): shr %cl, %r9 + mov %r9, (rp) + ret + +L(nb01):/* n = 2, 6, 10, ... */ + jne L(b11) +L(b10): mov (up), %r8 + mov 8(up), %r9 + xor %eax, %eax + shrd %cl, %r8, %rax + sub $3, n + jb L(le2) + mov 16(up), %r10 + lea 24(up), up + lea -8(rp), rp + jmp L(10) +L(le2): shrd %cl, %r9, %r8 + mov %r8, (rp) + shr %cl, %r9 + mov %r9, 8(rp) + ret + + .p2align 4 +L(b11): /* n = 3, 7, 11, ... */ + mov (up), %r11 + mov 8(up), %r8 + xor %eax, %eax + shrd %cl, %r11, %rax + mov 16(up), %r9 + lea 32(up), up + sub $4, n + jb L(end) + + .p2align 4 +L(top): shrd %cl, %r8, %r11 + mov -8(up), %r10 + mov %r11, (rp) +L(10): shrd %cl, %r9, %r8 + mov (up), %r11 + mov %r8, 8(rp) +L(01): shrd %cl, %r10, %r9 + mov 8(up), %r8 + mov %r9, 16(rp) +L(00): shrd %cl, %r11, %r10 + mov 16(up), %r9 + mov %r10, 24(rp) + add $32, up + lea 32(rp), rp + sub $4, n + jnc L(top) + +L(end): shrd %cl, %r8, %r11 + mov %r11, (rp) + shrd %cl, %r9, %r8 + mov %r8, 8(rp) + shr %cl, %r9 + mov %r9, 16(rp) ret END (__mpn_rshift) diff --git a/libc/sysdeps/x86_64/strlen.S b/libc/sysdeps/x86_64/strlen.S index 93aee6bef..28f828780 100644 --- a/libc/sysdeps/x86_64/strlen.S +++ b/libc/sysdeps/x86_64/strlen.S @@ -1,5 +1,5 @@ /* strlen(str) -- determine the length of the string STR. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Ulrich Drepper . This file is part of the GNU C Library. @@ -23,29 +23,80 @@ .text ENTRY(strlen) - pxor %xmm2, %xmm2 - movq %rdi, %rcx - movq %rdi, %r8 - andq $~15, %rdi - movdqa %xmm2, %xmm1 - pcmpeqb (%rdi), %xmm2 - orl $0xffffffff, %esi - subq %rdi, %rcx - shll %cl, %esi - pmovmskb %xmm2, %edx - andl %esi, %edx - jnz 1f - -2: movdqa 16(%rdi), %xmm0 - leaq 16(%rdi), %rdi + xor %rax, %rax + mov %edi, %ecx + and $0x3f, %ecx + pxor %xmm0, %xmm0 + cmp $0x30, %ecx + ja L(next) + movdqu (%rdi), %xmm1 pcmpeqb %xmm1, %xmm0 pmovmskb %xmm0, %edx - testl %edx, %edx - jz 2b + test %edx, %edx + jnz L(exit_less16) + mov %rdi, %rax + and $-16, %rax + jmp L(align16_start) +L(next): + mov %rdi, %rax + and $-16, %rax + pcmpeqb (%rax), %xmm0 + mov $-1, %esi + sub %rax, %rcx + shl %cl, %esi + pmovmskb %xmm0, %edx + and %esi, %edx + jnz L(exit) +L(align16_start): + pxor %xmm0, %xmm0 + pxor %xmm1, %xmm1 + pxor %xmm2, %xmm2 + pxor %xmm3, %xmm3 + .p2align 4 +L(align16_loop): + pcmpeqb 16(%rax), %xmm0 + pmovmskb %xmm0, %edx + test %edx, %edx + jnz L(exit16) -1: subq %r8, %rdi - bsfl %edx, %eax - addq %rdi, %rax + pcmpeqb 32(%rax), %xmm1 + pmovmskb %xmm1, %edx + test %edx, %edx + jnz L(exit32) + + pcmpeqb 48(%rax), %xmm2 + pmovmskb %xmm2, %edx + test %edx, %edx + jnz L(exit48) + + pcmpeqb 64(%rax), %xmm3 + pmovmskb %xmm3, %edx + lea 64(%rax), %rax + test %edx, %edx + jz L(align16_loop) +L(exit): + sub %rdi, %rax +L(exit_less16): + bsf %rdx, %rdx + add %rdx, %rax + ret + .p2align 4 +L(exit16): + sub %rdi, %rax + bsf %rdx, %rdx + lea 16(%rdx,%rax), %rax + ret + .p2align 4 +L(exit32): + sub %rdi, %rax + bsf %rdx, %rdx + lea 32(%rdx,%rax), %rax + ret + .p2align 4 +L(exit48): + sub %rdi, %rax + bsf %rdx, %rdx + lea 48(%rdx,%rax), %rax ret END(strlen) libc_hidden_builtin_def (strlen) diff --git a/libc/sysdeps/x86_64/sub_n.S b/libc/sysdeps/x86_64/sub_n.S index 48e1a2e0f..60c15fc3e 100644 --- a/libc/sysdeps/x86_64/sub_n.S +++ b/libc/sysdeps/x86_64/sub_n.S @@ -1,6 +1,6 @@ -/* AMD64 __mpn_sub_n -- Add two limb vectors of the same length > 0 and store +/* x86-64 __mpn_sub_n -- Add two limb vectors of the same length > 0 and store sum in a third limb vector. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -18,25 +18,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "sysdep.h" -#include "asm-syntax.h" +#define func __mpn_sub_n +#define ADCSBB sbb - .text -ENTRY (__mpn_sub_n) - leaq (%rsi,%rcx,8), %rsi - leaq (%rdi,%rcx,8), %rdi - leaq (%rdx,%rcx,8), %rdx - negq %rcx - xorl %eax, %eax # clear cy - .p2align 2 -L(loop): - movq (%rsi,%rcx,8), %rax - movq (%rdx,%rcx,8), %r10 - sbbq %r10, %rax - movq %rax, (%rdi,%rcx,8) - incq %rcx - jne L(loop) - movq %rcx, %rax # zero %rax - adcq %rax, %rax - ret -END (__mpn_sub_n) +#include "add_n.S" diff --git a/libc/sysdeps/x86_64/submul_1.S b/libc/sysdeps/x86_64/submul_1.S index e94c9a7be..150a92762 100644 --- a/libc/sysdeps/x86_64/submul_1.S +++ b/libc/sysdeps/x86_64/submul_1.S @@ -1,6 +1,6 @@ -/* AMD64 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract +/* x86-64 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract the result from a second limb vector. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify @@ -18,29 +18,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "sysdep.h" -#include "asm-syntax.h" +#define func __mpn_submul_1 +#define ADDSUB sub - .text -ENTRY (__mpn_submul_1) - movq %rdx, %r11 - leaq (%rsi,%r11,8), %rsi - leaq (%rdi,%r11,8), %rdi - negq %r11 - xorl %r8d, %r8d - .p2align 3 -L(loop): - movq (%rsi,%r11,8), %rax - movq (%rdi,%r11,8), %r10 - mulq %rcx - subq %r8, %r10 - movl $0, %r8d - adcl %r8d, %r8d - subq %rax, %r10 - adcq %rdx, %r8 - movq %r10, (%rdi,%r11,8) - incq %r11 - jne L(loop) - movq %r8, %rax - ret -END (__mpn_submul_1) +#include "addmul_1.S" -- cgit v1.2.3