diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-06-10 19:17:37 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-06-10 19:17:37 +0000 |
commit | cfd3e7c77b6bc0fae1f579fec477086e0d358662 (patch) | |
tree | 4748a08cef2f4fd92c8531d9db37fae19ed82a78 | |
parent | d37f23fb2b1487d48bbcf8d6d934f965cb9a621e (diff) |
Merge changes between r10503 and r10687 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@10688 7b3dc134-2b1b-0410-93df-9e9f96275f8d
30 files changed, 1224 insertions, 65 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog index e7215fd1a..d5f9d3033 100644 --- a/libc/ChangeLog +++ b/libc/ChangeLog @@ -1,3 +1,57 @@ +2010-06-02 Emilio Pozuelo Monfort <pochu27@gmail.com> + + * hurd/lookup-at.c (__file_name_lookup_at): Accept + AT_SYMLINK_FOLLOW in AT_FLAGS. Fail with EINVAL if both + AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW are present + in AT_FLAGS. + * hurd/hurd/fd.h (__file_name_lookup_at): Update comment. + * sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS. + +2010-05-28 Luis Machado <luisgpm@br.ibm.com> + + * sysdeps/powerpc/powerpc32/power7/memcpy.S: Exchange srdi for srwi. + +2010-05-26 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #11640] + * sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): + Properly check family and model. + +2010-05-26 Takashi Yoshii <takashi.yoshii.zj@renesas.com> + + * sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Fix iov[] size. + +2010-05-24 Luis Machado <luisgpm@br.ibm.com> + + * sysdeps/powerpc/powerpc32/power7/memset.S: POWER7 32-bit memset fix. + +2010-05-21 Ulrich Drepper <drepper@redhat.com> + + * elf/dl-runtime.c (_dl_profile_fixup): Don't crash on unresolved weak + symbol reference. + +2010-05-19 Andreas Schwab <schwab@redhat.com> + + * elf/dl-runtime.c (_dl_fixup): Don't crash on unresolved weak + symbol reference. + +2010-05-21 Andreas Schwab <schwab@redhat.com> + + * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add recvmmsg + and internal_recvmmsg. + * sysdeps/unix/sysv/linux/recvmmsg.c: New file. + * sysdeps/unix/sysv/linux/internal_recvmmsg.S: New file. + * sysdeps/unix/sysv/linux/socketcall.h (SOCKOP_recvmmsg): Define. + * sysdeps/unix/sysv/linux/syscalls.list (recvmmsg): Remove. + + * sunrpc/clnt_tcp.c (clnttcp_control): Add missing break. + * sunrpc/clnt_udp.c (clntudp_control): Likewise. + * sunrpc/clnt_unix.c (clntunix_control): Likewise. + +2010-05-20 Andreas Schwab <schwab@redhat.com> + + * sysdeps/unix/sysv/linux/sys/timex.h: Use __REDIRECT_NTH. + 2010-05-17 Luis Machado <luisgpm@br.ibm.com> POWER7 optimizations. diff --git a/libc/elf/dl-runtime.c b/libc/elf/dl-runtime.c index a52120d12..6847edafc 100644 --- a/libc/elf/dl-runtime.c +++ b/libc/elf/dl-runtime.c @@ -1,5 +1,5 @@ /* On-demand PLT fixup for shared objects. - Copyright (C) 1995-2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 1995-2009, 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 @@ -144,7 +144,8 @@ _dl_fixup ( /* And now perhaps the relocation addend. */ value = elf_machine_plt_value (l, reloc, value); - if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)) + if (sym != NULL + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)) value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) (); /* Finally, fix up the plt itself. */ @@ -231,8 +232,9 @@ _dl_profile_fixup ( ? LOOKUP_VALUE_ADDRESS (result) + defsym->st_value : 0); - if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info) - == STT_GNU_IFUNC, 0)) + if (defsym != NULL + && __builtin_expect (ELFW(ST_TYPE) (defsym->st_info) + == STT_GNU_IFUNC, 0)) value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) (); } @@ -369,7 +371,7 @@ _dl_profile_fixup ( struct audit_ifaces *afct = GLRO(dl_audit); for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { - if (afct->ARCH_LA_PLTENTER != NULL + if (afct->ARCH_LA_PLTENTER != NULL && (reloc_result->enterexit & (LA_SYMB_NOPLTENTER << (2 * (cnt + 1)))) == 0) { diff --git a/libc/hurd/hurd/fd.h b/libc/hurd/hurd/fd.h index d1aa867cb..247347608 100644 --- a/libc/hurd/hurd/fd.h +++ b/libc/hurd/hurd/fd.h @@ -254,8 +254,9 @@ extern int _hurd_select (int nfds, struct pollfd *pollfds, const sigset_t *sigmask); /* Variant of file_name_lookup used in *at function implementations. - AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits - cause EINVAL. */ + AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW, + which will remove and add O_NOLINK from FLAGS respectively. + Other bits cause EINVAL. */ extern file_t __file_name_lookup_at (int fd, int at_flags, const char *file_name, int flags, mode_t mode); diff --git a/libc/hurd/lookup-at.c b/libc/hurd/lookup-at.c index 7f55527d8..728a97090 100644 --- a/libc/hurd/lookup-at.c +++ b/libc/hurd/lookup-at.c @@ -30,8 +30,14 @@ __file_name_lookup_at (int fd, int at_flags, error_t err; file_t result; + if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW)) + return (__hurd_fail (EINVAL), MACH_PORT_NULL); + flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0; at_flags &= ~AT_SYMLINK_NOFOLLOW; + if (at_flags & AT_SYMLINK_FOLLOW) + flags &= ~O_NOLINK; + at_flags &= ~AT_SYMLINK_FOLLOW; if (at_flags != 0) return (__hurd_fail (EINVAL), MACH_PORT_NULL); diff --git a/libc/sunrpc/clnt_tcp.c b/libc/sunrpc/clnt_tcp.c index 1552be87a..d26a1268a 100644 --- a/libc/sunrpc/clnt_tcp.c +++ b/libc/sunrpc/clnt_tcp.c @@ -399,6 +399,7 @@ clnttcp_control (CLIENT *cl, int request, char *info) /* This will set the xid of the NEXT call */ *(u_long *)ct->ct_mcall = htonl (*(u_long *)info - 1); /* decrement by 1 as clnttcp_call() increments once */ + break; case CLGET_VERS: /* * This RELIES on the information that, in the call body, diff --git a/libc/sunrpc/clnt_udp.c b/libc/sunrpc/clnt_udp.c index 62ee3a1c9..360e26a59 100644 --- a/libc/sunrpc/clnt_udp.c +++ b/libc/sunrpc/clnt_udp.c @@ -582,6 +582,7 @@ clntudp_control (CLIENT *cl, int request, char *info) /* This will set the xid of the NEXT call */ *(u_long *)cu->cu_outbuf = htonl(*(u_long *)info - 1); /* decrement by 1 as clntudp_call() increments once */ + break; case CLGET_VERS: /* * This RELIES on the information that, in the call body, diff --git a/libc/sunrpc/clnt_unix.c b/libc/sunrpc/clnt_unix.c index db3ea312a..bca1273e2 100644 --- a/libc/sunrpc/clnt_unix.c +++ b/libc/sunrpc/clnt_unix.c @@ -376,6 +376,7 @@ clntunix_control (CLIENT *cl, int request, char *info) /* This will set the xid of the NEXT call */ *(u_long *) ct->ct_mcall = htonl (*(u_long *)info - 1); /* decrement by 1 as clntunix_call() increments once */ + break; case CLGET_VERS: /* * This RELIES on the information that, in the call body, diff --git a/libc/sysdeps/mach/hurd/linkat.c b/libc/sysdeps/mach/hurd/linkat.c index 1942144e0..062d913e3 100644 --- a/libc/sysdeps/mach/hurd/linkat.c +++ b/libc/sysdeps/mach/hurd/linkat.c @@ -1,5 +1,5 @@ /* Make a link between file names relative to open directories. Hurd version. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 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 @@ -38,7 +38,9 @@ linkat (fromfd, from, tofd, to, flags) file_t oldfile, linknode, todir; char *toname; - oldfile = __file_name_lookup_at (fromfd, flags, from, 0, 0); + /* POSIX says linkat doesn't follow symlinks by default, so pass + O_NOLINK. That can be overridden by AT_SYMLINK_FOLLOW in FLAGS. */ + oldfile = __file_name_lookup_at (fromfd, flags, from, O_NOLINK, 0); if (oldfile == MACH_PORT_NULL) return -1; diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S index e3dfd2ff9..f0c332f1b 100644 --- a/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S +++ b/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S @@ -365,7 +365,7 @@ L(copy_GE_32_unaligned): addi 3,3,8 0: clrlwi 10,12,28 /* Check alignment of SRC. */ - srdi 9,31,4 /* Number of full quadwords remaining. */ + srwi 9,31,4 /* Number of full quadwords remaining. */ /* The proper alignment is present, it is OK to copy the bytes now. */ L(copy_GE_32_unaligned_cont): @@ -375,7 +375,7 @@ L(copy_GE_32_unaligned_cont): li 6,16 /* Index for 16-bytes offsets. */ li 7,32 /* Index for 32-bytes offsets. */ cmplwi cr1,11,0 - srdi 8,31,5 /* Setup the loop counter. */ + srwi 8,31,5 /* Setup the loop counter. */ mr 10,3 mr 11,12 mtcrf 0x01,9 diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memset.S b/libc/sysdeps/powerpc/powerpc32/power7/memset.S new file mode 100644 index 000000000..8aabb4932 --- /dev/null +++ b/libc/sysdeps/powerpc/powerpc32/power7/memset.S @@ -0,0 +1,434 @@ +/* Optimized memset implementation for PowerPC32/POWER7. + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Luis Machado <luisgpm@br.ibm.com>. + 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., 51 Franklin Street, Fifth Floor, Boston MA + 02110-1301 USA. */ + +#include <sysdep.h> +#include <bp-sym.h> +#include <bp-asm.h> + +/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); + Returns 's'. */ + + .machine power7 +EALIGN (BP_SYM (memset), 5, 0) + CALL_MCOUNT + + .align 4 +L(_memset): + cmplwi cr7,5,31 + cmplwi cr6,5,8 + mr 10,3 /* Save original argument for later. */ + mr 7,1 /* Save original r1 for later. */ + cfi_offset(31,-8) + + /* Replicate byte to word. */ + rlwimi 4,4,8,16,23 + rlwimi 4,4,16,0,15 + + ble cr6,L(small) /* If length <= 8, use short copy code. */ + + neg 0,3 + ble cr7,L(medium) /* If length < 32, use medium copy code. */ + + /* Save our word twice to create a doubleword that we will later + copy to a FPR. */ + stwu 1,-32(1) + andi. 11,10,7 /* Check alignment of DST. */ + mr 12,5 + stw 4,24(1) + stw 4,28(1) + beq L(big_aligned) + + clrlwi 0,0,29 + mtocrf 0x01,0 + subf 5,0,5 + + /* Get DST aligned to 8 bytes. */ +1: bf 31,2f + + stb 4,0(10) + addi 10,10,1 +2: bf 30,4f + + sth 4,0(10) + addi 10,10,2 +4: bf 29,L(big_aligned) + + stw 4,0(10) + addi 10,10,4 + + .align 4 +L(big_aligned): + cmplwi cr5,5,255 + li 0,32 + cmplwi cr1,5,160 + dcbtst 0,10 + cmplwi cr6,4,0 + srwi 9,5,3 /* Number of full doublewords remaining. */ + crand 27,26,21 + mtocrf 0x01,9 + bt 27,L(huge) + + /* From this point on, we'll copy 32+ bytes and the value + isn't 0 (so we can't use dcbz). */ + + srwi 8,5,5 + clrlwi 11,5,29 + cmplwi cr6,11,0 + cmplwi cr1,9,4 + mtctr 8 + + /* Copy 1~3 doublewords so the main loop starts + at a multiple of 32 bytes. */ + + bf 30,1f + + stw 4,0(10) + stw 4,4(10) + stw 4,8(10) + stw 4,12(10) + addi 10,10,16 + bf 31,L(big_loop) + + stw 4,0(10) + stw 4,4(10) + addi 10,10,8 + mr 12,10 + blt cr1,L(tail_bytes) + + b L(big_loop) + + .align 4 +1: /* Copy 1 doubleword. */ + bf 31,L(big_loop) + + stw 4,0(10) + stw 4,4(10) + addi 10,10,8 + + /* First use a 32-bytes loop with stw's to try and avoid the LHS due + to the lfd we will do next. Also, ping-pong through r10 and r12 + to avoid AGEN delays. */ + .align 4 +L(big_loop): + addi 12,10,32 + stw 4,0(10) + stw 4,4(10) + stw 4,8(10) + stw 4,12(10) + stw 4,16(10) + stw 4,20(10) + stw 4,24(10) + stw 4,28(10) + bdz L(tail_bytes) + + addi 10,10,64 + stw 4,0(12) + stw 4,4(12) + stw 4,8(12) + stw 4,12(12) + stw 4,16(12) + stw 4,20(12) + stw 4,24(12) + stw 4,28(12) + bdnz L(big_loop_fast_setup) + + mr 12,10 + b L(tail_bytes) + + /* Now that we're probably past the LHS window, use the VSX to + speed up the loop. */ +L(big_loop_fast_setup): + li 11,24 + li 6,16 + lxvdsx 4,1,11 + + .align 4 +L(big_loop_fast): + addi 12,10,32 + stxvd2x 4,0,10 + stxvd2x 4,10,6 + bdz L(tail_bytes) + + addi 10,10,64 + stxvd2x 4,0,12 + stxvd2x 4,12,6 + bdnz L(big_loop_fast) + + mr 12,10 + + .align 4 +L(tail_bytes): + + /* Check for tail bytes. */ + mr 1,7 /* Restore r1. */ + beqlr cr6 + + clrlwi 0,5,29 + mtocrf 0x01,0 + + /* At this point we have a tail of 0-7 bytes and we know that the + destination is doubleword-aligned. */ +4: /* Copy 4 bytes. */ + bf 29,2f + + stw 4,0(12) + addi 12,12,4 +2: /* Copy 2 bytes. */ + bf 30,1f + + sth 4,0(12) + addi 12,12,2 +1: /* Copy 1 byte. */ + bflr 31 + + stb 4,0(12) + blr + + + /* Special case when value is 0 and we have a long length to deal + with. Use dcbz to zero out 128-bytes at a time. Before using + dcbz though, we need to get the destination 128-bytes aligned. */ + .align 4 +L(huge): + lfd 4,24(1) + andi. 11,10,127 + neg 0,10 + beq L(huge_aligned) + + clrlwi 0,0,25 + subf 5,0,5 + srwi 0,0,3 + mtocrf 0x01,0 + + /* Get DST aligned to 128 bytes. */ +8: bf 28,4f + + stfd 4,0(10) + stfd 4,8(10) + stfd 4,16(10) + stfd 4,24(10) + stfd 4,32(10) + stfd 4,40(10) + stfd 4,48(10) + stfd 4,56(10) + addi 10,10,64 + .align 4 +4: bf 29,2f + + stfd 4,0(10) + stfd 4,8(10) + stfd 4,16(10) + stfd 4,24(10) + addi 10,10,32 + .align 4 +2: bf 30,1f + + stfd 4,0(10) + stfd 4,8(10) + addi 10,10,16 + .align 4 +1: bf 31,L(huge_aligned) + + stfd 4,0(10) + addi 10,10,8 + +L(huge_aligned): + srwi 8,5,7 + clrlwi 11,5,25 + cmplwi cr6,11,0 + mtctr 8 + + /* Copies 128-bytes at a time. */ + .align 4 +L(huge_loop): + dcbz 0,10 + addi 10,10,128 + bdnz L(huge_loop) + + /* We have a tail of 0~127 bytes to handle. */ + mr 1,7 /* Restore r1. */ + beqlr cr6 + + subf 9,3,10 + subf 5,9,12 + srwi 8,5,3 + cmplwi cr6,8,0 + mtocrf 0x01,8 + + /* We have a tail o 1~127 bytes. Copy up to 15 doublewords for + speed. We'll handle the resulting tail bytes later. */ + beq cr6,L(tail) + +8: bf 28,4f + + stfd 4,0(10) + stfd 4,8(10) + stfd 4,16(10) + stfd 4,24(10) + stfd 4,32(10) + stfd 4,40(10) + stfd 4,48(10) + stfd 4,56(10) + addi 10,10,64 + .align 4 +4: bf 29,2f + + stfd 4,0(10) + stfd 4,8(10) + stfd 4,16(10) + stfd 4,24(10) + addi 10,10,32 + .align 4 +2: bf 30,1f + + stfd 4,0(10) + stfd 4,8(10) + addi 10,10,16 + .align 4 +1: bf 31,L(tail) + + stfd 4,0(10) + addi 10,10,8 + + /* Handle the rest of the tail bytes here. */ +L(tail): + mtocrf 0x01,5 + + .align 4 +4: bf 29,2f + + stw 4,0(10) + addi 10,10,4 + .align 4 +2: bf 30,1f + + sth 4,0(10) + addi 10,10,2 + .align 4 +1: bflr 31 + + stb 4,0(10) + blr + + + /* Expanded tree to copy tail bytes without increments. */ + .align 4 +L(copy_tail): + bf 29,L(FXX) + + stw 4,0(10) + bf 30,L(TFX) + + sth 4,4(10) + bflr 31 + + stb 4,6(10) + blr + + .align 4 +L(FXX): bf 30,L(FFX) + + sth 4,0(10) + bflr 31 + + stb 4,2(10) + blr + + .align 4 +L(TFX): bflr 31 + + stb 4,4(10) + blr + + .align 4 +L(FFX): bflr 31 + + stb 4,0(10) + blr + + /* Handle copies of 9~31 bytes. */ + .align 4 +L(medium): + /* At least 9 bytes to go. */ + andi. 11,10,3 + clrlwi 0,0,30 + beq L(medium_aligned) + + /* Force 4-bytes alignment for DST. */ + mtocrf 0x01,0 + subf 5,0,5 +1: /* Copy 1 byte. */ + bf 31,2f + + stb 4,0(10) + addi 10,10,1 +2: /* Copy 2 bytes. */ + bf 30,L(medium_aligned) + + sth 4,0(10) + addi 10,10,2 + + .align 4 +L(medium_aligned): + /* At least 6 bytes to go, and DST is word-aligned. */ + cmplwi cr1,5,16 + mtocrf 0x01,5 + blt cr1,8f + + /* Copy 16 bytes. */ + stw 4,0(10) + stw 4,4(10) + stw 4,8(10) + stw 4,12(10) + addi 10,10,16 +8: /* Copy 8 bytes. */ + bf 28,4f + + stw 4,0(10) + stw 4,4(10) + addi 10,10,8 +4: /* Copy 4 bytes. */ + bf 29,2f + + stw 4,0(10) + addi 10,10,4 +2: /* Copy 2-3 bytes. */ + bf 30,1f + + sth 4,0(10) + addi 10,10,2 +1: /* Copy 1 byte. */ + bflr 31 + + stb 4,0(10) + blr + + /* Handles copies of 0~8 bytes. */ + .align 4 +L(small): + mtocrf 0x01,5 + bne cr6,L(copy_tail) + + stw 4,0(10) + stw 4,4(10) + blr + +END (BP_SYM (memset)) +libc_hidden_builtin_def (memset) diff --git a/libc/sysdeps/powerpc/powerpc64/power7/memset.S b/libc/sysdeps/powerpc/powerpc64/power7/memset.S new file mode 100644 index 000000000..02a9eedd6 --- /dev/null +++ b/libc/sysdeps/powerpc/powerpc64/power7/memset.S @@ -0,0 +1,398 @@ +/* Optimized memset implementation for PowerPC64/POWER7. + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Luis Machado <luisgpm@br.ibm.com>. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <sysdep.h> +#include <bp-sym.h> +#include <bp-asm.h> + +/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); + Returns 's'. */ + + .machine power7 +EALIGN (BP_SYM (memset), 5, 0) + CALL_MCOUNT 3 + +L(_memset): + cmpldi cr7,5,31 + cmpldi cr6,5,8 + mr 10,3 + + /* Replicate byte to word. */ + rlwimi 4,4,8,16,23 + rlwimi 4,4,16,0,15 + ble cr6,L(small) /* If length <= 8, use short copy code. */ + + neg 0,3 + ble cr7,L(medium) /* If length < 32, use medium copy code. */ + + andi. 11,10,7 /* Check alignment of SRC. */ + insrdi 4,4,32,0 /* Replicate word to double word. */ + + mr 12,5 + beq L(big_aligned) + + clrldi 0,0,61 + mtocrf 0x01,0 + subf 5,0,5 + + /* Get DST aligned to 8 bytes. */ +1: bf 31,2f + + stb 4,0(10) + addi 10,10,1 +2: bf 30,4f + + sth 4,0(10) + addi 10,10,2 +4: bf 29,L(big_aligned) + + stw 4,0(10) + addi 10,10,4 + + .align 4 +L(big_aligned): + + cmpldi cr5,5,255 + li 0,32 + dcbtst 0,10 + cmpldi cr6,4,0 + srdi 9,5,3 /* Number of full doublewords remaining. */ + crand 27,26,21 + mtocrf 0x01,9 + bt 27,L(huge) + + /* From this point on, we'll copy 32+ bytes and the value + isn't 0 (so we can't use dcbz). */ + + srdi 8,5,5 + clrldi 11,5,61 + cmpldi cr6,11,0 + cmpldi cr1,9,4 + mtctr 8 + + /* Copy 1~3 doublewords so the main loop starts + at a multiple of 32 bytes. */ + + bf 30,1f + + std 4,0(10) + std 4,8(10) + addi 10,10,16 + bf 31,L(big_loop) + + std 4,0(10) + addi 10,10,8 + mr 12,10 + blt cr1,L(tail_bytes) + b L(big_loop) + + .align 4 +1: /* Copy 1 doubleword. */ + bf 31,L(big_loop) + + std 4,0(10) + addi 10,10,8 + + /* Main aligned copy loop. Copies 32-bytes at a time and + ping-pong through r10 and r12 to avoid AGEN delays. */ + .align 4 +L(big_loop): + addi 12,10,32 + std 4,0(10) + std 4,8(10) + std 4,16(10) + std 4,24(10) + bdz L(tail_bytes) + + addi 10,10,64 + std 4,0(12) + std 4,8(12) + std 4,16(12) + std 4,24(12) + bdnz L(big_loop) + + mr 12,10 + b L(tail_bytes) + + .align 4 +L(tail_bytes): + + /* Check for tail bytes. */ + beqlr cr6 + + clrldi 0,5,61 + mtocrf 0x01,0 + + /* At this point we have a tail of 0-7 bytes and we know that the + destination is doubleword-aligned. */ +4: /* Copy 4 bytes. */ + bf 29,2f + + stw 4,0(12) + addi 12,12,4 +2: /* Copy 2 bytes. */ + bf 30,1f + + sth 4,0(12) + addi 12,12,2 +1: /* Copy 1 byte. */ + bflr 31 + + stb 4,0(12) + blr + + /* Special case when value is 0 and we have a long length to deal + with. Use dcbz to zero out 128-bytes at a time. Before using + dcbz though, we need to get the destination 128-bytes aligned. */ + .align 4 +L(huge): + andi. 11,10,127 + neg 0,10 + beq L(huge_aligned) + + clrldi 0,0,57 + subf 5,0,5 + srdi 0,0,3 + mtocrf 0x01,0 + + /* Get DST aligned to 128 bytes. */ +8: bf 28,4f + + std 4,0(10) + std 4,8(10) + std 4,16(10) + std 4,24(10) + std 4,32(10) + std 4,40(10) + std 4,48(10) + std 4,56(10) + addi 10,10,64 + .align 4 +4: bf 29,2f + + std 4,0(10) + std 4,8(10) + std 4,16(10) + std 4,24(10) + addi 10,10,32 + .align 4 +2: bf 30,1f + + std 4,0(10) + std 4,8(10) + addi 10,10,16 + .align 4 +1: bf 31,L(huge_aligned) + + std 4,0(10) + addi 10,10,8 + + +L(huge_aligned): + srdi 8,5,7 + clrldi 11,5,57 + cmpldi cr6,11,0 + mtctr 8 + + .align 4 +L(huge_loop): + dcbz 0,10 + addi 10,10,128 + bdnz L(huge_loop) + + /* Check how many bytes are still left. */ + beqlr cr6 + + subf 9,3,10 + subf 5,9,12 + srdi 8,5,3 + cmpldi cr6,8,0 + mtocrf 0x01,8 + + /* We have a tail o 1~127 bytes. Copy up to 15 doublewords for + speed. We'll handle the resulting tail bytes later. */ + beq cr6,L(tail) + +8: bf 28,4f + + std 4,0(10) + std 4,8(10) + std 4,16(10) + std 4,24(10) + std 4,32(10) + std 4,40(10) + std 4,48(10) + std 4,56(10) + addi 10,10,64 + .align 4 +4: bf 29,2f + + std 4,0(10) + std 4,8(10) + std 4,16(10) + std 4,24(10) + addi 10,10,32 + .align 4 +2: bf 30,1f + + std 4,0(10) + std 4,8(10) + addi 10,10,16 + .align 4 +1: bf 31,L(tail) + + std 4,0(10) + addi 10,10,8 + + /* Handle the rest of the tail bytes here. */ +L(tail): + mtocrf 0x01,5 + + .align 4 +4: bf 29,2f + + stw 4,0(10) + addi 10,10,4 + .align 4 +2: bf 30,1f + + sth 4,0(10) + addi 10,10,2 + .align 4 +1: bflr 31 + + stb 4,0(10) + blr + + /* Expanded tree to copy tail bytes without increments. */ + .align 4 +L(copy_tail): + bf 29,L(FXX) + + stw 4,0(10) + bf 30,L(TFX) + + sth 4,4(10) + bflr 31 + + stb 4,6(10) + blr + + .align 4 +L(FXX): bf 30,L(FFX) + + sth 4,0(10) + bflr 31 + + stb 4,2(10) + blr + + .align 4 +L(TFX): bflr 31 + + stb 4,4(10) + blr + + .align 4 +L(FFX): bflr 31 + + stb 4,0(10) + blr + + /* Handle copies of 9~31 bytes. */ + .align 4 +L(medium): + /* At least 9 bytes to go. */ + andi. 11,10,3 + clrldi 0,0,62 + beq L(medium_aligned) + + /* Force 4-bytes alignment for SRC. */ + mtocrf 0x01,0 + subf 5,0,5 +1: /* Copy 1 byte. */ + bf 31,2f + + stb 4,0(10) + addi 10,10,1 +2: /* Copy 2 bytes. */ + bf 30,L(medium_aligned) + + sth 4,0(10) + addi 10,10,2 + + .align 4 +L(medium_aligned): + /* At least 6 bytes to go, and DST is word-aligned. */ + cmpldi cr1,5,16 + mtocrf 0x01,5 + blt cr1,8f + + /* Copy 16 bytes. */ + stw 4,0(10) + stw 4,4(10) + stw 4,8(10) + stw 4,12(10) + addi 10,10,16 +8: /* Copy 8 bytes. */ + bf 28,4f + + stw 4,0(10) + stw 4,4(10) + addi 10,10,8 +4: /* Copy 4 bytes. */ + bf 29,2f + + stw 4,0(10) + addi 10,10,4 +2: /* Copy 2-3 bytes. */ + bf 30,1f + + sth 4,0(10) + addi 10,10,2 +1: /* Copy 1 byte. */ + bflr 31 + + stb 4,0(10) + blr + + /* Handles copies of 0~8 bytes. */ + .align 4 +L(small): + mtocrf 0x01,5 + bne cr6,L(copy_tail) + + stw 4,0(10) + stw 4,4(10) + blr + +END_GEN_TB (BP_SYM (memset),TB_TOCLESS) +libc_hidden_builtin_def (memset) + +/* Copied from bzero.S to prevent the linker from inserting a stub + between bzero and memset. */ +ENTRY (BP_SYM (__bzero)) + CALL_MCOUNT 3 + mr r5,r4 + li r4,0 + b L(_memset) +END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS) + +weak_alias (BP_SYM (__bzero), BP_SYM (bzero)) diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile index a9596de20..f7f769422 100644 --- a/libc/sysdeps/unix/sysv/linux/Makefile +++ b/libc/sysdeps/unix/sysv/linux/Makefile @@ -12,7 +12,7 @@ CFLAGS-malloc.c += -DMORECORE_CLEARS=2 endif ifeq ($(subdir),socket) -sysdep_routines += internal_accept4 +sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg endif ifeq ($(subdir),misc) diff --git a/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S b/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S new file mode 100644 index 000000000..66c135794 --- /dev/null +++ b/libc/sysdeps/unix/sysv/linux/internal_recvmmsg.S @@ -0,0 +1,14 @@ +#include <kernel-features.h> +#include <sys/syscall.h> +#if !defined __NR_recvmmsg && defined __NR_socketcall +# define socket recvmmsg +# ifdef __ASSUME_RECVMMSG +# define __socket recvmmsg +# else +# define __socket __internal_recvmmsg +# endif +# define NARGS 5 +# define NEED_CANCELLATION +# define NO_WEAK_ALIAS +# include <socket.S> +#endif diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h index 43783c1e2..b3f245615 100644 --- a/libc/sysdeps/unix/sysv/linux/kernel-features.h +++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h @@ -525,3 +525,8 @@ #if __LINUX_KERNEL_VERSION >= 0x020620 # define __ASSUME_F_GETOWN_EX 1 #endif + +/* Support for the recvmmsg syscall was added in 2.6.33. */ +#if __LINUX_KERNEL_VERSION >= 0x020621 +# define __ASSUME_RECVMMSG 1 +#endif diff --git a/libc/sysdeps/unix/sysv/linux/recvmmsg.c b/libc/sysdeps/unix/sysv/linux/recvmmsg.c new file mode 100644 index 000000000..0c08171d4 --- /dev/null +++ b/libc/sysdeps/unix/sysv/linux/recvmmsg.c @@ -0,0 +1,100 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@redhat.com>, 2010. + + 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 <errno.h> +#include <sys/socket.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <kernel-features.h> + + +#ifdef __NR_recvmmsg +int +recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, + const struct timespec *tmo) +{ + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +#elif defined __NR_socketcall +# ifndef __ASSUME_RECVMMSG +extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages, + unsigned int vlen, int flags, + const struct timespec *tmo) + attribute_hidden; + +static int have_recvmmsg; + +int +recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, + const struct timespec *tmo) +{ + if (__builtin_expect (have_recvmmsg >= 0, 1)) + { + int ret = __internal_recvmmsg (fd, vmessages, vlen, flags, tmo); + /* The kernel returns -EINVAL for unknown socket operations. + We need to convert that error to an ENOSYS error. */ + if (__builtin_expect (ret < 0, 0) + && have_recvmmsg == 0 + && errno == EINVAL) + { + /* Try another call, this time with an invalid file + descriptor and all other parameters cleared. This call + will not cause any harm and it will return + immediately. */ + ret = __internal_recvmmsg (-1, 0, 0, 0, 0); + if (errno == EINVAL) + { + have_recvmmsg = -1; + __set_errno (ENOSYS); + } + else + { + have_recvmmsg = 1; + __set_errno (EINVAL); + } + return -1; + } + return ret; + } + __set_errno (ENOSYS); + return -1; +} +# else +/* When __ASSUME_RECVMMSG recvmmsg is defined in internal_recvmmsg.S. */ +# endif +#else +int +recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, + const struct timespec *tmo) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (recvmmsg) +#endif diff --git a/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h index e3c9c0e63..92df0858e 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h +++ b/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h @@ -1,5 +1,5 @@ /* Dump registers. - Copyright (C) 1999, 2000, 2009 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2009, 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 @@ -58,7 +58,7 @@ register_dump (int fd, struct sigcontext *ctx) { char regs[22][8]; char fpregs[34][8]; - struct iovec iov[112]; + struct iovec iov[22 * 2 + 34 * 2 + 2]; size_t nr = 0; #define ADD_STRING(str) \ diff --git a/libc/sysdeps/unix/sysv/linux/socketcall.h b/libc/sysdeps/unix/sysv/linux/socketcall.h index adf01b6e1..bab4e4a51 100644 --- a/libc/sysdeps/unix/sysv/linux/socketcall.h +++ b/libc/sysdeps/unix/sysv/linux/socketcall.h @@ -44,5 +44,6 @@ #define SOCKOP_sendmsg 16 #define SOCKOP_recvmsg 17 #define SOCKOP_accept4 18 +#define SOCKOP_recvmmsg 19 #endif /* sys/socketcall.h */ diff --git a/libc/sysdeps/unix/sysv/linux/sys/timex.h b/libc/sysdeps/unix/sysv/linux/sys/timex.h index e10311f70..13b94d6f4 100644 --- a/libc/sysdeps/unix/sysv/linux/sys/timex.h +++ b/libc/sysdeps/unix/sysv/linux/sys/timex.h @@ -140,9 +140,9 @@ __BEGIN_DECLS extern int __adjtimex (struct timex *__ntx) __THROW; extern int adjtimex (struct timex *__ntx) __THROW; -#if defined __GNUC__ && __GNUC__ >= 2 -extern int ntp_gettime (struct ntptimeval *__ntv) - __asm__ ("ntp_gettimex") __THROW; +#ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), + ntp_gettimex); #else extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; # define ntp_gettime ntp_gettimex diff --git a/libc/sysdeps/unix/sysv/linux/syscalls.list b/libc/sysdeps/unix/sysv/linux/syscalls.list index a1a449eb4..a87906a4e 100644 --- a/libc/sysdeps/unix/sysv/linux/syscalls.list +++ b/libc/sysdeps/unix/sysv/linux/syscalls.list @@ -53,7 +53,6 @@ prctl EXTRA prctl i:iiiii __prctl prctl putpmsg - putpmsg i:ippii putpmsg query_module EXTRA query_module i:sipip query_module quotactl EXTRA quotactl i:isip quotactl -recvmmsg EXTRA recvmmsg Ci:ipiip recvmmsg remap_file_pages - remap_file_pages i:piiii __remap_file_pages remap_file_pages sched_getp - sched_getparam i:ip __sched_getparam sched_getparam sched_gets - sched_getscheduler i:i __sched_getscheduler sched_getscheduler diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.c b/libc/sysdeps/x86_64/multiarch/init-arch.c index efb89b6c9..f13a9f4b7 100644 --- a/libc/sysdeps/x86_64/multiarch/init-arch.c +++ b/libc/sysdeps/x86_64/multiarch/init-arch.c @@ -62,15 +62,15 @@ __init_cpu_features (void) unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax; unsigned int extended_family = (eax >> 20) & 0xff; unsigned int extended_model = (eax >> 12) & 0xf0; - if (__cpu_features.family == 0x0f) + if (family == 0x0f) { family += extended_family; model += extended_model; } - else if (__cpu_features.family == 0x06) + else if (family == 0x06) { model += extended_model; - switch (__cpu_features.model) + switch (model) { case 0x1a: case 0x1e: diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm index 363b86521..29d3fe98d 100644 --- a/ports/ChangeLog.arm +++ b/ports/ChangeLog.arm @@ -1,3 +1,7 @@ +2010-05-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S: New. + 2010-04-08 Daniel Jacobowitz <dan@codesourcery.com> * sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: New file. diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa index 7dd7ce6dc..50a15d74c 100644 --- a/ports/ChangeLog.hppa +++ b/ports/ChangeLog.hppa @@ -1,3 +1,8 @@ +2010-06-07 Andreas Schwab <schwab@redhat.com> + + * sysdeps/unix/sysv/linux/hppa/nptl/pthread.h: Update to agree + with generic file. + 2010-03-30 Carlos O'Donell <carlos@codesourcery.com> * sysdeps/unix/sysv/linux/hppa/bits/socket.h: Define @@ -21,7 +26,7 @@ 2010-02-02 Carlos O'Donell <carlos@codesourcery.com> * sysdeps/unix/sysv/linux/hppa/makecontext.c (__makecontext): - Support more than 8 arguments. + Support more than 8 arguments. 2010-02-01 Kyle McMartin <kyle@redhat.com> @@ -48,7 +53,7 @@ * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h: Use correct alignment for pthread_mutex_t, pthread_cond_t, - and pthread_rwlock_t. + and pthread_rwlock_t. 2009-11-22 Carlos O'Donell <carlos@codesourcery.com> @@ -64,7 +69,7 @@ 2009-11-15 Carlos O'Donell <carlos@codesourcery.com> - * sysdeps/unix/sysv/linux/hppa/Versions (libc): Add + * sysdeps/unix/sysv/linux/hppa/Versions (libc): Add fallocate64@@GLIBC_2.11. * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_GNU]: Define F_GETOWN_EX, and F_SETOWN_EX. @@ -72,7 +77,7 @@ [__USE_FILE_OFFSET64 && __REDIRECT]: Define __REDIRECT. [__USE_FILE_OFFSET64 && !__REDIRECT]: Define fallocate as fallocate64. - [__USE_LARGEFILE64]: define fallocate64. + [__USE_LARGEFILE64]: define fallocate64. 2009-11-15 Carlos O'Donell <carlos@codesourcery.com> @@ -108,10 +113,10 @@ * sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c: Remove. 2009-09-08 Carlos O'Donell <carlos@codesourcery.com> - + sysdeps/unix/sysv/linux/hppa/ * internaltypes.h: New file. - + sysdeps/unix/sysv/linux/hppa/nptl/ * pthreadP.h: New file. * pthread.h: New file. @@ -159,7 +164,7 @@ 2009-02-25 Carlos O'Donell <carlos@codesourcery.com> - * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define + * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME, and FUTEX_BITSET_MATCH_ANY. @@ -173,7 +178,7 @@ 2009-02-13 Khem Raj <raj.khem@gmail.com> - * sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c + * sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c (libgcc_s_handle): New variable. (pthread_cancel_init): Depend in libgcc_s_handle for decision to load DSO. Assign last. @@ -201,9 +206,9 @@ Carlos O'Donell <carlos@systemhalted.org> [BZ #6037] - * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Check for -11 + * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Check for -11 (-EAGAIN) instead of 11. Loop again when the kernel - returns -45 (-EDEADLOCK). Add back memory clobber. + returns -45 (-EDEADLOCK). Add back memory clobber. Do not initialize lws_ret and lws_errno. 2008-06-17 Guy Martin <gmsoft@tuxicoman.be> @@ -237,7 +242,7 @@ Guy Martin <gmsoft@tuxicoman.be> [BZ #5923] - * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Pass + * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Pass timespec and futexp. 2008-02-22 Carlos O'Donell <carlos@codesourcery.com> @@ -385,7 +390,7 @@ 2007-05-17 Carlos O'Donell <carlos@systemhalted.org> - * sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h + * sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h (SEM_VALUE_MAX): Remove. 2007-05-17 Carlos O'Donell <carlos@systemhalted.org> @@ -395,14 +400,14 @@ (INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE. (INTERNAL_SYSCALL): Likewise. (INTERNAL_SYSCALL_NCS): Likewise. - * sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use + * sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use PIC_REG_DEF, PIC_REG_USE. 2007-05-01 Carlos O'Donell <carlos@systemhalted.org> * sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h - [__USE_XOPEN2K]: Define pthread_rwlock_t and - pthread_rwlockattr_t. + [__USE_XOPEN2K]: Define pthread_rwlock_t and + pthread_rwlockattr_t. 2007-02-02 Carlos O'Donell <carlos@systemhalted.org> @@ -436,18 +441,18 @@ 2006-09-20 Carlos O'Donell <carlos@systemhalted.org> * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h (splice): Add offin - and offout arguments to the prototype. + and offout arguments to the prototype. 2006-09-15 Carlos O'Donell <carlos@systemhalted.org> * sysdeps/hppa/nptl/tcb-offsets.sym: Define TID_THREAD_OFFSET. - * sysdeps/unix/sysv/linux/hppa/clone.S: Handle RESET_PID, and + * sysdeps/unix/sysv/linux/hppa/clone.S: Handle RESET_PID, and restore r19 before call to _exit. * sysdeps/unix/sysv/linux/hppa/nptl/clone.S: New file. 2006-09-13 Carlos O'Donell <carlos@systemhalted.org> - * sysdeps/hppa/dl-machine.h (RTLD_START): Comment the use of + * sysdeps/hppa/dl-machine.h (RTLD_START): Comment the use of _dl_fini_plabel. * sysdeps/hppa/elf/start.S: Correctly pass r23 to argument 6 of __libc_start_main. Comment the order of arguments at entry and @@ -467,7 +472,7 @@ as -EAGAIN. * sysdeps/unix/sysv/linux/hppa/bits/mman.h: Adjust definitions to match required standards. - * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h + * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h (lll_futex_wait): Return __ret. (lll_futex_timed_wait): Likewise. (lll_futex_wake): Likewise. @@ -490,7 +495,7 @@ 2006-07-24 Carlos O'Donell <carlos@systemhalted.org> - * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h: + * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h: __SIZEOF_PTHREAD_COND_T is 64 bytes. Remove __PAD_ATOMIC_LOCK_T. 2006-07-18 Carlos O'Donell <carlos@systemhalted.org> @@ -516,7 +521,7 @@ * sysdeps/unix/sysv/linux/hppa/xstat.c: New file. * sysdeps/unix/sysv/linux/hppa/lxstat.c: Likewise. - * sysdeps/unix/sysv/linux/hppa/fxstat.c: Likewise. + * sysdeps/unix/sysv/linux/hppa/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/hppa/fxstatat.c: Likewise. 2006-07-13 Carlos O'Donell <carlos@systemhalted.org> @@ -545,12 +550,12 @@ 2006-06-08 Carlos O'Donell <carlos@systemhalted.org> - * sysdeps/unix/sysv/linux/hppa/Versions: new errlist compat entry + * sysdeps/unix/sysv/linux/hppa/Versions: new errlist compat entry for up to 256 errnos 2006-06-08 Carlos O'Donell <carlos@systemhalted.org> - * sysdeps/hppa/hppa1.1/Implies: Remove ieee754/ldbl-128. + * sysdeps/hppa/hppa1.1/Implies: Remove ieee754/ldbl-128. * sysdeps/unix/sysv/linux/hppa/kernel-features.h [__LINUX_KERNEL_VERSION >= 0x020609]: Define __ASSUME_LWS_CAS. * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: New file. @@ -648,9 +653,9 @@ 2006-04-19 Carlos O'Donell <carlos@systemhalted.org> - * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_GNU]: + * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_GNU]: Define MMAP_FIXED. - * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_GNU]: + * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_GNU]: Define SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_AFTER, sync_file_range, splice, tee. diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k index c7d068e36..cdc0ab507 100644 --- a/ports/ChangeLog.m68k +++ b/ports/ChangeLog.m68k @@ -1,3 +1,8 @@ +2010-05-22 Andreas Schwab <schwab@linux-m68k.org> + + * data/c++-types-m68k-linux-gnu.data: New file. + * data/localplt-m68k-linux-gnu.data: New file. + 2010-03-13 Andreas Schwab <schwab@linux-m68k.org> * sysdeps/m68k/m680x0/fpu/s_ccosh.c: Use signbit macro. diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips index 2ea65732c..dbdb68c79 100644 --- a/ports/ChangeLog.mips +++ b/ports/ChangeLog.mips @@ -1,3 +1,8 @@ +2010-05-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c, + sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S: New. + 2010-04-14 Joseph Myers <joseph@codesourcery.com> * sysdeps/unix/sysv/linux/mips/libc-abis: New. diff --git a/ports/data/c++-types-m68k-linux-gnu.data b/ports/data/c++-types-m68k-linux-gnu.data new file mode 100644 index 000000000..fde53bf33 --- /dev/null +++ b/ports/data/c++-types-m68k-linux-gnu.data @@ -0,0 +1,67 @@ +blkcnt64_t:x +blkcnt_t:l +blksize_t:l +caddr_t:Pc +clockid_t:i +clock_t:l +daddr_t:i +dev_t:y +fd_mask:l +fsblkcnt64_t:y +fsblkcnt_t:m +fsfilcnt64_t:y +fsfilcnt_t:m +fsid_t:8__fsid_t +gid_t:j +id_t:j +ino64_t:y +ino_t:m +int16_t:s +int32_t:i +int64_t:x +int8_t:a +intptr_t:i +key_t:i +loff_t:x +mode_t:j +nlink_t:j +off64_t:x +off_t:l +pid_t:i +pthread_attr_t:14pthread_attr_t +pthread_barrier_t:17pthread_barrier_t +pthread_barrierattr_t:21pthread_barrierattr_t +pthread_cond_t:14pthread_cond_t +pthread_condattr_t:18pthread_condattr_t +pthread_key_t:j +pthread_mutex_t:15pthread_mutex_t +pthread_mutexattr_t:19pthread_mutexattr_t +pthread_once_t:i +pthread_rwlock_t:16pthread_rwlock_t +pthread_rwlockattr_t:20pthread_rwlockattr_t +pthread_spinlock_t:i +pthread_t:m +quad_t:x +register_t:i +rlim64_t:y +rlim_t:m +sigset_t:10__sigset_t +size_t:j +socklen_t:j +ssize_t:i +suseconds_t:l +time_t:l +u_char:h +uid_t:j +uint:j +u_int:j +u_int16_t:t +u_int32_t:j +u_int64_t:y +u_int8_t:h +ulong:m +u_long:m +u_quad_t:y +useconds_t:j +ushort:t +u_short:t diff --git a/ports/data/localplt-m68k-linux-gnu.data b/ports/data/localplt-m68k-linux-gnu.data new file mode 100644 index 000000000..d266b8f74 --- /dev/null +++ b/ports/data/localplt-m68k-linux-gnu.data @@ -0,0 +1,8 @@ +libc.so: _Unwind_Find_FDE +libc.so: __m68k_read_tp +libc.so: calloc +libc.so: free +libc.so: malloc +libc.so: memalign +libc.so: realloc +libm.so: matherr diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S b/ports/sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S new file mode 100644 index 000000000..eeb5f50a2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S @@ -0,0 +1,6 @@ +/* Tag_ABI_align8_preserved: This code preserves 8-byte + alignment in any callee. */ + .eabi_attribute 25, 1 +/* Tag_ABI_align8_needed: This code may require 8-byte alignment from + the caller. */ + .eabi_attribute 24, 1 diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h index 7e279668d..ee91dbf5b 100644 --- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -25,8 +25,6 @@ #include <sched.h> #include <time.h> -#define __need_sigset_t -#include <signal.h> #include <bits/pthreadtypes.h> #include <bits/setjmp.h> #include <bits/wordsize.h> @@ -49,7 +47,7 @@ enum PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP -#ifdef __USE_UNIX98 +#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, @@ -427,6 +425,18 @@ extern int pthread_setschedprio (pthread_t __target_thread, int __prio) __THROW; +#ifdef __USE_GNU +/* Get thread name visible in the kernel and its interfaces. */ +extern int pthread_getname_np (pthread_t __target_thread, char *__buf, + size_t __buflen) + __THROW __nonnull ((2)); + +/* Set thread name visible in the kernel and its interfaces. */ +extern int pthread_setname_np (pthread_t __target_thread, __const char *__name) + __THROW __nonnull ((2)); +#endif + + #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency (void) __THROW; @@ -739,8 +749,8 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, - __const struct timespec *__restrict - __abstime) __THROW __nonnull ((1, 2)); + __const struct timespec *__restrict + __abstime) __THROW __nonnull ((1, 2)); #endif /* Unlock a mutex. */ @@ -748,7 +758,6 @@ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); -#ifdef __USE_UNIX98 /* Get the priority ceiling of MUTEX. */ extern int pthread_mutex_getprioceiling (__const pthread_mutex_t * __restrict __mutex, @@ -761,12 +770,11 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __THROW __nonnull ((1, 3)); -#endif #ifdef __USE_XOPEN2K8 /* Declare the state protected by MUTEX as consistent. */ -extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) +extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); # ifdef __USE_GNU extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) @@ -797,7 +805,7 @@ extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, int __pshared) __THROW __nonnull ((1)); -#ifdef __USE_UNIX98 +#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return in *KIND the mutex kind attribute in *ATTR. */ extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) @@ -808,6 +816,7 @@ extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) __THROW __nonnull ((1)); +#endif /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t * @@ -831,7 +840,6 @@ extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t * extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, int __prioceiling) __THROW __nonnull ((1)); -#endif #ifdef __USE_XOPEN2K /* Get the robustness flag of the mutex attribute ATTR. */ @@ -990,13 +998,13 @@ extern int pthread_condattr_destroy (pthread_condattr_t *__attr) /* Get the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_getpshared (__const pthread_condattr_t * - __restrict __attr, - int *__restrict __pshared) + __restrict __attr, + int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, - int __pshared) __THROW __nonnull ((1)); + int __pshared) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Get the clock selected for the conditon variable attribute ATTR. */ @@ -1071,7 +1079,7 @@ extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * /* Set the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, - int __pshared) + int __pshared) __THROW __nonnull ((1)); #endif @@ -1136,11 +1144,11 @@ __END_DECLS #endif /* pthread.h */ -#ifndef _PTHREAD_H_HPPA_ +#ifndef _PTHREAD_H_HPPA_ #define _PTHREAD_H_HPPA_ 1 /* The pthread_cond_t initializer is compatible only with NPTL. We do not - want to be forwards compatible, we eventually want to drop the code + want to be forwards compatible, we eventually want to drop the code that has to clear the old LT initializer. */ #undef PTHREAD_COND_INITIALIZER #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, (void *) 0, 0, 0, 0, 0, 0 } } @@ -1173,6 +1181,5 @@ __END_DECLS { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ 0, 0, 0 } } #endif /* Unix98 or XOpen2K */ - -#endif +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S new file mode 100644 index 000000000..30434d733 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S @@ -0,0 +1,2 @@ +/* MIPS does not have socket.S and the socketcall syscall should + generally be avoided, though it exists. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c new file mode 100644 index 000000000..ceb88eee8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c @@ -0,0 +1,31 @@ +/* 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. */ + +/* Avoid recvmmsg.c trying to use a definition based on the socketcall + syscall and internal_recvmmsg.S. */ + +#include <errno.h> +#include <sys/socket.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <kernel-features.h> + +#undef __NR_socketcall + +#include <sysdeps/unix/sysv/linux/recvmmsg.c> |