summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ia64/memchr.S17
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cosl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sinl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cosl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_expm1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_sinl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_tanl.c8
-rw-r--r--sysdeps/mach/hurd/.cvsignore4
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power6/memcpy.S56
-rw-r--r--sysdeps/powerpc/powerpc32/power6/memset.S6
-rw-r--r--sysdeps/powerpc/sysdep.h4
-rw-r--r--sysdeps/unix/common/.cvsignore4
-rw-r--r--sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/accept4.c49
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h6
-rw-r--r--sysdeps/unix/sysv/linux/eventfd.c15
-rw-r--r--sysdeps/unix/sysv/linux/grantpt.c13
-rw-r--r--sysdeps/unix/sysv/linux/i386/accept4.S4
-rw-r--r--sysdeps/unix/sysv/linux/i386/internal_accept4.S1
-rw-r--r--sysdeps/unix/sysv/linux/internal_accept4.S14
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h4
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h4
-rw-r--r--sysdeps/unix/sysv/linux/signalfd.c15
-rw-r--r--sysdeps/unix/sysv/linux/socketcall.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/socket.h16
-rw-r--r--sysdeps/unix/sysv/linux/sys/epoll.h4
-rw-r--r--sysdeps/x86_64/dl-trampoline.S6
-rw-r--r--sysdeps/x86_64/memchr.S6
34 files changed, 245 insertions, 92 deletions
diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S
index e9a7ba8230..cd062b2dd5 100644
--- a/sysdeps/ia64/memchr.S
+++ b/sysdeps/ia64/memchr.S
@@ -96,7 +96,8 @@ ENTRY(__memchr)
mov pr.rot = 1 << 16 ;;
.l2:
(p[0]) mov addr[0] = ret0
-(p[0]) ld8 value[0] = [ret0], 8
+(p[0]) ld8.s value[0] = [ret0], 8 // speculative load
+(p[MEMLAT]) chk.s value[MEMLAT], .recovery // check and recovery
(p[MEMLAT]) xor aux[0] = value[MEMLAT], chrx8
(p[MEMLAT+1]) czx1.r poschr[0] = aux[1]
(p[MEMLAT+2]) cmp.ne p7, p0 = 8, poschr[1]
@@ -124,6 +125,20 @@ ENTRY(__memchr)
mov ar.lc = saved_lc
br.ret.sptk.many b0
+.recovery:
+ adds ret0 = -((MEMLAT + 1) * 8), ret0;;
+(p[MEMLAT+1]) add ret0 = -8, ret0;;
+(p[MEMLAT+2]) add ret0 = -8, ret0;;
+.l4:
+ mov addr[MEMLAT+2] = ret0
+ ld8 tmp = [ret0];; // load the first unchecked 8byte
+ xor aux[1] = tmp, chrx8;;
+ czx1.r poschr[1] = aux[1];;
+ cmp.ne p7, p0 = 8, poschr[1]
+(p7) br.cond.spnt .foundit;;
+ adds ret0 = 8, ret0 // load the next unchecked 8byte
+ br.sptk .l4;;
+
END(__memchr)
weak_alias (__memchr, memchr)
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index d1258b2cf1..ef61c3afdb 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -66,7 +67,14 @@
return __kernel_cosl(x,z);
/* cos(Inf or NaN) is NaN */
- else if (ix>=0x7fff000000000000LL) return x-x;
+ else if (ix>=0x7fff000000000000LL) {
+ if (ix == 0x7fff000000000000LL) {
+ GET_LDOUBLE_LSW64(n,x);
+ if (n == 0)
+ __set_errno (EDOM);
+ }
+ return x-x;
+ }
/* argument reduction needed */
else {
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index 78bbe65b53..a82489bb24 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -53,6 +53,7 @@
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -121,7 +122,10 @@ __expm1l (long double x)
/* Overflow. */
if (x > maxlog)
- return (big * big);
+ {
+ __set_errno (ERANGE);
+ return (big * big);
+ }
/* Minimum value. */
if (x < minarg)
diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 446a75f126..dc509e72e5 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -66,7 +67,14 @@
return __kernel_sinl(x,z,0);
/* sin(Inf or NaN) is NaN */
- else if (ix>=0x7fff000000000000LL) return x-x;
+ else if (ix>=0x7fff000000000000LL) {
+ if (ix == 0x7fff000000000000LL) {
+ GET_LDOUBLE_LSW64(n,x);
+ if (n == 0)
+ __set_errno (EDOM);
+ }
+ return x-x;
+ }
/* argument reduction needed */
else {
diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c
index ea9d053d9b..2349da67f1 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -65,7 +66,14 @@
if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanl(x,z,1);
/* tanl(Inf or NaN) is NaN */
- else if (ix>=0x7fff000000000000LL) return x-x; /* NaN */
+ else if (ix>=0x7fff000000000000LL) {
+ if (ix == 0x7fff000000000000LL) {
+ GET_LDOUBLE_LSW64(n,x);
+ if (n == 0)
+ __set_errno (EDOM);
+ }
+ return x-x; /* NaN */
+ }
/* argument reduction needed */
else {
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
index 59a8196706..8470850fc8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -67,9 +68,11 @@
return __kernel_cosl(x,z);
/* cos(Inf or NaN) is NaN */
- else if (ix>=0x7ff0000000000000LL)
+ else if (ix>=0x7ff0000000000000LL) {
+ if (ix == 0x7ff0000000000000LL)
+ __set_errno (EDOM);
return x-x;
-
+ }
/* argument reduction needed */
else {
n = __ieee754_rem_pio2l(x,y);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 735006575f..f631eddf59 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -51,6 +51,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -120,7 +121,10 @@ __expm1l (long double x)
/* Overflow. */
if (x > maxlog)
- return (big * big);
+ {
+ __set_errno (ERANGE);
+ return (big * big);
+ }
/* Minimum value. */
if (x < minarg)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
index 8cc592c612..bd72225e18 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -67,8 +68,11 @@
return __kernel_sinl(x,z,0);
/* sin(Inf or NaN) is NaN */
- else if (ix>=0x7ff0000000000000LL) return x-x;
-
+ else if (ix>=0x7ff0000000000000LL) {
+ if (ix == 0x7ff0000000000000LL)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
n = __ieee754_rem_pio2l(x,y);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
index ea5a7f0ffb..913f38f243 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -66,8 +67,11 @@
if(ix <= 0x3fe921fb54442d10LL) return __kernel_tanl(x,z,1);
/* tanl(Inf or NaN) is NaN */
- else if (ix>=0x7ff0000000000000LL) return x-x; /* NaN */
-
+ else if (ix>=0x7ff0000000000000LL) {
+ if (ix == 0x7ff0000000000000LL)
+ __set_errno (EDOM);
+ return x-x; /* NaN */
+ }
/* argument reduction needed */
else {
n = __ieee754_rem_pio2l(x,y);
diff --git a/sysdeps/mach/hurd/.cvsignore b/sysdeps/mach/hurd/.cvsignore
deleted file mode 100644
index 1f69fd919a..0000000000
--- a/sysdeps/mach/hurd/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
index 6aef4e301b..95a0b3915d 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
@@ -60,8 +60,8 @@ EALIGN (__sqrt, 5, 0)
fmr fp12,fp2
stw r0,20(r1)
stw r30,8(r1)
- cfi_offset(lr,20)
- cfi_offset(r30,8)
+ cfi_offset(lr,20-16)
+ cfi_offset(r30,8-16)
#ifdef SHARED
# ifdef HAVE_ASM_PPC_REL16
bcl 20,31,.LCF1
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
index e5b8b9d565..c31555194b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
@@ -60,8 +60,8 @@ EALIGN (__sqrtf, 5, 0)
fmr fp12,fp2
stw r0,20(r1)
stw r30,8(r1)
- cfi_offset(lr,20)
- cfi_offset(r30,8)
+ cfi_offset(lr,20-16)
+ cfi_offset(r30,8-16)
#ifdef SHARED
# ifdef HAVE_ASM_PPC_REL16
bcl 20,31,.LCF1
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
index 925930bf77..105b5912a1 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
@@ -60,8 +60,8 @@ EALIGN (__sqrt, 5, 0)
fmr fp12,fp2
stw r0,20(r1)
stw r30,8(r1)
- cfi_offset(lr,20)
- cfi_offset(r30,8)
+ cfi_offset(lr,20-16)
+ cfi_offset(r30,8-16)
#ifdef SHARED
# ifdef HAVE_ASM_PPC_REL16
bcl 20,31,.LCF1
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
index 891e69c9c0..14bc0a2ceb 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
@@ -60,8 +60,8 @@ EALIGN (__sqrtf, 5, 0)
fmr fp12,fp2
stw r0,20(r1)
stw r30,8(r1)
- cfi_offset(lr,20)
- cfi_offset(r30,8)
+ cfi_offset(lr,20-16)
+ cfi_offset(r30,8-16)
#ifdef SHARED
# ifdef HAVE_ASM_PPC_REL16
bcl 20,31,.LCF1
diff --git a/sysdeps/powerpc/powerpc32/power6/memcpy.S b/sysdeps/powerpc/powerpc32/power6/memcpy.S
index ba45fd250c..156b0bd8cc 100644
--- a/sysdeps/powerpc/powerpc32/power6/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/power6/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32 on POWER6.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2009 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
@@ -25,9 +25,9 @@
Returns 'dst'.
Memcpy handles short copies (< 32-bytes) using a binary move blocks
- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled
- with the appropriate combination of byte and halfword load/stores.
- There is minimal effort to optimize the alignment of short moves.
+ (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled
+ with the appropriate combination of byte and halfword load/stores.
+ There is minimal effort to optimize the alignment of short moves.
Longer moves (>= 32-bytes) justify the effort to get at least the
destination word (4-byte) aligned. Further optimization is
@@ -80,11 +80,11 @@ EALIGN (BP_SYM (memcpy), 5, 0)
bne- cr6,L(wdu) /* If source is not word aligned. .L6 */
clrlwi 11,31,30 /* calculate the number of tail bytes */
b L(word_aligned)
- /* Copy words from source to destination, assuming the destination is
+ /* Copy words from source to destination, assuming the destination is
aligned on a word boundary.
At this point we know there are at least 29 bytes left (32-3) to copy.
- The next step is to determine if the source is also word aligned.
+ The next step is to determine if the source is also word aligned.
If not branch to the unaligned move code at .L6. which uses
a load, shift, store strategy.
@@ -100,9 +100,9 @@ EALIGN (BP_SYM (memcpy), 5, 0)
/* Move words where destination and source are word aligned.
Use an unrolled loop to copy 4 words (16-bytes) per iteration.
- If the the copy is not an exact multiple of 16 bytes, 1-3
+ If the the copy is not an exact multiple of 16 bytes, 1-3
words are copied as needed to set up the main loop. After
- the main loop exits there may be a tail of 1-3 bytes. These bytes are
+ the main loop exits there may be a tail of 1-3 bytes. These bytes are
copied a halfword/byte at a time as needed to preserve alignment. */
L(word_aligned):
mtcrf 0x01,9
@@ -121,7 +121,7 @@ L(word_aligned):
addi 10,3,8
bf 31,4f
lwz 0,8(12)
- stw 0,8(3)
+ stw 0,8(3)
blt cr1,3f
addi 11,12,12
addi 10,3,12
@@ -135,7 +135,7 @@ L(word_aligned):
addi 11,12,4
stw 6,0(3)
addi 10,3,4
-
+
.align 4
4:
lwz 6,0(11)
@@ -149,14 +149,14 @@ L(word_aligned):
addi 11,11,16
addi 10,10,16
bdnz 4b
-3:
+3:
clrrwi 0,31,2
mtcrf 0x01,31
beq cr6,0f
.L9:
add 3,3,0
add 12,12,0
-
+
/* At this point we have a tail of 0-3 bytes and we know that the
destination is word aligned. */
2: bf 30,1f
@@ -175,7 +175,7 @@ L(word_aligned):
addi 1,1,32
blr
-/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31
+/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31
bytes. Each case is handled without loops, using binary (1,2,4,8)
tests.
@@ -208,7 +208,7 @@ L(word_unaligned_short):
andi. 0,8,3
beq cr6,L(wus_8) /* Handle moves of 8 bytes. */
/* At least 9 bytes left. Get the source word aligned. */
- cmpldi cr1,5,16
+ cmplwi cr1,5,16
mr 12,4
ble cr6,L(wus_4) /* Handle moves of 0-8 bytes. */
mr 11,3
@@ -241,7 +241,7 @@ L(wus_tail):
/* At least 6 bytes left and the source is word aligned. This allows
some speculative loads up front. */
/* We need to special case the fall-through because the biggest delays
- are due to address computation not being ready in time for the
+ are due to address computation not being ready in time for the
AGEN. */
lwz 6,0(12)
lwz 7,4(12)
@@ -336,7 +336,7 @@ L(wus_tail4): /* Move 4 bytes. */
L(wus_tail2): /* Move 2-3 bytes. */
bf 30,L(wus_tail1)
lhz 6,0(12)
- sth 6,0(11)
+ sth 6,0(11)
bf 31,L(wus_tailX)
lbz 7,2(12)
stb 7,2(11)
@@ -368,7 +368,7 @@ L(wus_4):
stw 6,0(3)
bf 30,L(wus_5)
lhz 7,4(4)
- sth 7,4(3)
+ sth 7,4(3)
bf 31,L(wus_0)
lbz 8,6(4)
stb 8,6(3)
@@ -386,7 +386,7 @@ L(wus_5):
L(wus_2): /* Move 2-3 bytes. */
bf 30,L(wus_1)
lhz 6,0(4)
- sth 6,0(3)
+ sth 6,0(3)
bf 31,L(wus_0)
lbz 7,2(4)
stb 7,2(3)
@@ -410,13 +410,13 @@ L(wdu):
/* Copy words where the destination is aligned but the source is
not. For power4, power5 and power6 machines there is penalty for
- unaligned loads (src) that cross 32-byte, cacheline, or page
+ unaligned loads (src) that cross 32-byte, cacheline, or page
boundaries. So we want to use simple (unaligned) loads where
posible but avoid them where we know the load would span a 32-byte
- boundary.
+ boundary.
At this point we know we have at least 29 (32-3) bytes to copy
- the src is unaligned. and we may cross at least one 32-byte
+ the src is unaligned. and we may cross at least one 32-byte
boundary. Also we have the following regester values:
r3 == adjusted dst, word aligned
r4 == unadjusted src
@@ -427,7 +427,7 @@ L(wdu):
r31 == adjusted len
First we need to copy word upto but not crossing the next 32-byte
- boundary. Then perform aligned loads just before and just after
+ boundary. Then perform aligned loads just before and just after
the boundary and use shifts and or to gernerate the next aligned
word for dst. If more then 32 bytes remain we copy (unaligned src)
the next 7 words and repeat the loop until less then 32-bytes
@@ -442,7 +442,7 @@ L(wdu):
mr 4,12 /* restore unaligned adjusted src ptr */
clrlwi 0,12,27 /* Find dist from previous 32-byte boundary. */
slwi 10,10,3 /* calculate number of bits to shift 1st word left */
- cmplwi cr5,0,16
+ cmplwi cr5,0,16
subfic 8,0,32 /* Number of bytes to next 32-byte boundary. */
mtcrf 0x01,8
@@ -532,7 +532,7 @@ L(wdu_32):
lwz 6,0(12)
cmplwi cr6,31,4
srwi 8,31,5 /* calculate the 32 byte loop count */
- slw 0,6,10
+ slw 0,6,10
clrlwi 31,31,27 /* The remaining bytes, < 32. */
blt cr5,L(wdu_32tail)
mtctr 8
@@ -543,7 +543,7 @@ L(wdu_loop32):
lwz 8,4(12)
addi 12,12,32
lwz 7,4(4)
- srw 8,8,9
+ srw 8,8,9
or 0,0,8
stw 0,0(3)
stw 7,4(3)
@@ -562,7 +562,7 @@ L(wdu_loop32):
stw 6,24(3)
stw 7,28(3)
addi 3,3,32
- slw 0,8,10
+ slw 0,8,10
bdnz+ L(wdu_loop32)
L(wdu_32tail):
@@ -571,7 +571,7 @@ L(wdu_32tail):
blt cr6,L(wdu_4tail)
/* calculate and store the final word */
lwz 8,4(12)
- srw 8,8,9
+ srw 8,8,9
or 6,0,8
b L(wdu_32tailx)
#endif
@@ -816,7 +816,7 @@ L(wdu_4tail):
beq cr6,L(wdus_0) /* If the tail is 0 bytes we are done! */
bf 30,L(wdus_3)
lhz 7,0(4)
- sth 7,0(3)
+ sth 7,0(3)
bf 31,L(wdus_0)
lbz 8,2(4)
stb 8,2(3)
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S
index 10fb7b9786..cc65b7be9a 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -1,5 +1,5 @@
/* Optimized 32-bit memset implementation for POWER6.
- Copyright (C) 1997,99, 2000,02,03,06,2007 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,02,03,06,2007,2009 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
@@ -240,7 +240,7 @@ L(nzCacheAligned256):
cmplwi cr1,rLEN,256
addi rMEMP3,rMEMP,64
#ifdef NOT_IN_libc
-/* When we are not in libc we should use only GPRs to avoid the FPU lock
+/* When we are not in libc we should use only GPRs to avoid the FPU lock
interrupt. */
stw rCHR,0(rMEMP)
stw rCHR,4(rMEMP)
@@ -381,7 +381,7 @@ L(cacheAligned):
blt cr1,L(cacheAligned1)
li rMEMP2,128
L(cacheAlignedx):
- cmpldi cr5,rLEN,640
+ cmplwi cr5,rLEN,640
blt cr6,L(cacheAligned128)
bgt cr5,L(cacheAligned512)
cmplwi cr6,rLEN,512
diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h
index 43edeb71eb..f5c79c54ef 100644
--- a/sysdeps/powerpc/sysdep.h
+++ b/sysdeps/powerpc/sysdep.h
@@ -44,8 +44,8 @@
#define PPC_FEATURE_PA6T 0x00000800 /* PA Semi 6T Core */
#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
#define PPC_FEATURE_POWER6_EXT 0x00000200 /* P6 + mffgpr/mftgpr */
-#define PPC_FEATURE_HAS_VSX 0x00000100 /* P7 Vector Extension. */
-#define PPC_FEATURE_ARCH_2_06 0x00000080 /* ISA 2.06 */
+#define PPC_FEATURE_ARCH_2_06 0x00000100 /* ISA 2.06 */
+#define PPC_FEATURE_HAS_VSX 0x00000080 /* P7 Vector Extension. */
#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
#ifdef __ASSEMBLER__
diff --git a/sysdeps/unix/common/.cvsignore b/sysdeps/unix/common/.cvsignore
deleted file mode 100644
index 1f69fd919a..0000000000
--- a/sysdeps/unix/common/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 170c042dd1..cee5d29255 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -11,6 +11,10 @@ ifeq ($(subdir),malloc)
CFLAGS-malloc.c += -DMORECORE_CLEARS=2
endif
+ifeq ($(subdir),socket)
+sysdep_routines += internal_accept4
+endif
+
ifeq ($(subdir),misc)
sysdep_routines += sysctl clone llseek umount umount2 readahead \
setfsuid setfsgid makedev epoll_pwait signalfd \
diff --git a/sysdeps/unix/sysv/linux/accept4.c b/sysdeps/unix/sysv/linux/accept4.c
index 97f7b8ce62..9ef9f479b0 100644
--- a/sysdeps/unix/sysv/linux/accept4.c
+++ b/sysdeps/unix/sysv/linux/accept4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2008.
@@ -23,8 +23,7 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-
-#define __NR_accept4 288
+#include <kernel-features.h>
#ifdef __NR_accept4
@@ -43,6 +42,50 @@ accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
return result;
}
+#elif defined __NR_socketcall
+# ifndef __ASSUME_ACCEPT4
+extern int __internal_accept4 (int fd, __SOCKADDR_ARG addr,
+ socklen_t *addr_len, int flags)
+ attribute_hidden;
+
+static int have_accept4;
+
+int
+accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
+{
+ if (__builtin_expect (have_accept4 >= 0, 1))
+ {
+ int ret = __internal_accept4 (fd, addr, addr_len, flags);
+ /* 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_accept4 == 0
+ && errno == EINVAL)
+ {
+ /* Try another call, this time with the FLAGS parameter
+ cleared and an invalid file descriptor. This call will not
+ cause any harm and it will return immediately. */
+ ret = __internal_accept4 (-1, addr, addr_len, 0);
+ if (errno == EINVAL)
+ {
+ have_accept4 = -1;
+ __set_errno (ENOSYS);
+ }
+ else
+ {
+ have_accept4 = 1;
+ __set_errno (EINVAL);
+ }
+ return -1;
+ }
+ return ret;
+ }
+ __set_errno (ENOSYS);
+ return -1;
+}
+# else
+/* When __ASSUME_ACCEPT4 accept4 is defined in internal_accept4.S. */
+# endif
#else
int
accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 88062e59ad..f23b338a35 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008
+ Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -108,7 +108,8 @@ enum __socket_type
#define PF_RXRPC 33 /* RxRPC sockets. */
#define PF_ISDN 34 /* mISDN sockets. */
#define PF_PHONET 35 /* Phonet sockets. */
-#define PF_MAX 36 /* For now.. */
+#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
+#define PF_MAX 37 /* For now.. */
/* Address families. */
#define AF_UNSPEC PF_UNSPEC
@@ -148,6 +149,7 @@ enum __socket_type
#define AF_RXRPC PF_RXRPC
#define AF_ISDN PF_ISDN
#define AF_PHONET PF_PHONET
+#define AF_IEEE802154 PF_IEEE802154
#define AF_MAX PF_MAX
/* Socket level values. Others are defined in the appropriate headers.
diff --git a/sysdeps/unix/sysv/linux/eventfd.c b/sysdeps/unix/sysv/linux/eventfd.c
index 4cd557983e..7f69ecdb8c 100644
--- a/sysdeps/unix/sysv/linux/eventfd.c
+++ b/sysdeps/unix/sysv/linux/eventfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009 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
@@ -19,14 +19,21 @@
#include <errno.h>
#include <sys/eventfd.h>
#include <sysdep.h>
+#include <kernel-features.h>
int
eventfd (int count, int flags)
{
#ifdef __NR_eventfd2
- return INLINE_SYSCALL (eventfd2, 2, count, flags);
-#else
+ int res = INLINE_SYSCALL (eventfd2, 2, count, flags);
+# ifndef __ASSUME_EVENTFD2
+ if (res != -1 || errno != ENOSYS)
+# endif
+ return res;
+#endif
+
+#ifndef __ASSUME_EVENTFD2
/* The old system call has no flag parameter which is bad. So we have
to wait until we have to support to pass additional values to the
kernel (sys_indirect) before implementing setting flags like
@@ -43,5 +50,7 @@ eventfd (int count, int flags)
__set_errno (ENOSYS);
return -1;
# endif
+#elif !defined __NR_eventfd2
+# error "__ASSUME_EVENTFD2 defined but not __NR_eventfd2"
#endif
}
diff --git a/sysdeps/unix/sysv/linux/grantpt.c b/sysdeps/unix/sysv/linux/grantpt.c
index b894b8b631..c858f89c8b 100644
--- a/sysdeps/unix/sysv/linux/grantpt.c
+++ b/sysdeps/unix/sysv/linux/grantpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2002, 2009 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
@@ -70,9 +70,16 @@ grantpt (int fd)
return -1;
/* If the slave pseudo terminal lives on a `devpts' filesystem, the
- ownership and access permission are already set. */
+ ownership is already set and the access permission might already
+ be set. */
if (fsbuf.f_type == DEVPTS_SUPER_MAGIC || fsbuf.f_type == DEVFS_SUPER_MAGIC)
- return 0;
+ {
+ struct stat64 st;
+
+ if (fstat (fd, &st) == 0
+ && (st.st_mode & ACCESSPERMS) == (S_IRUSR|S_IWUSR|S_IWGRP))
+ return 0;
+ }
return __unix_grantpt (fd);
}
diff --git a/sysdeps/unix/sysv/linux/i386/accept4.S b/sysdeps/unix/sysv/linux/i386/accept4.S
index 087ccc456f..1d05eff7f7 100644
--- a/sysdeps/unix/sysv/linux/i386/accept4.S
+++ b/sysdeps/unix/sysv/linux/i386/accept4.S
@@ -24,10 +24,6 @@
#define EINVAL 22
#define ENOSYS 38
-#ifndef SOCKOP_accept4
-# define SOCKOP_accept4 18
-#endif
-
#ifdef __ASSUME_ACCEPT4
# define errlabel SYSCALL_ERROR_LABEL
#else
diff --git a/sysdeps/unix/sysv/linux/i386/internal_accept4.S b/sysdeps/unix/sysv/linux/i386/internal_accept4.S
new file mode 100644
index 0000000000..c3f1630494
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/internal_accept4.S
@@ -0,0 +1 @@
+/* Not needed, accept4.S has everything. */
diff --git a/sysdeps/unix/sysv/linux/internal_accept4.S b/sysdeps/unix/sysv/linux/internal_accept4.S
new file mode 100644
index 0000000000..ffc553624c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/internal_accept4.S
@@ -0,0 +1,14 @@
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#if !defined __NR_accept4 && defined __NR_socketcall
+# define socket accept4
+# ifdef __ASSUME_ACCEPT4
+# define __socket accept4
+# else
+# define __socket __internal_accept4
+# endif
+# define NARGS 4
+# define NEED_CANCELLATION
+# define NO_WEAK_ALIAS
+# include <socket.S>
+#endif
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 473360a13c..ff065effb5 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -516,12 +516,14 @@
# define __ASSUME_SOCK_CLOEXEC 1
# define __ASSUME_IN_NONBLOCK 1
# define __ASSUME_PIPE2 1
+# define __ASSUME_EVENTFD2 1
+# define __ASSUME_SIGNALFD4 1
#endif
/* Support for the accept4 syscall was added in 2.6.28. */
#if __LINUX_KERNEL_VERSION >= 0x02061c \
&& (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
- || defined __ia64__ || defined __sparc__ || defined __s390__)
+ || defined __sparc__ || defined __s390__)
# define __ASSUME_ACCEPT4 1
#endif
diff --git a/sysdeps/unix/sysv/linux/net/if_arp.h b/sysdeps/unix/sysv/linux/net/if_arp.h
index 9608652ee4..97cb61f62b 100644
--- a/sysdeps/unix/sysv/linux/net/if_arp.h
+++ b/sysdeps/unix/sysv/linux/net/if_arp.h
@@ -1,5 +1,5 @@
/* Definitions for Address Resolution Protocol.
- Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2001,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -128,6 +128,8 @@ struct arphdr
#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
+#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 header. */
+#define ARPHRD_IEEE802154_PHY 805 /* IEEE 802.15.4 PHY header. */
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
#define ARPHRD_NONE 0xFFFE /* Zero header length. */
diff --git a/sysdeps/unix/sysv/linux/signalfd.c b/sysdeps/unix/sysv/linux/signalfd.c
index 9898f29231..c2d974a45d 100644
--- a/sysdeps/unix/sysv/linux/signalfd.c
+++ b/sysdeps/unix/sysv/linux/signalfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009 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
@@ -20,14 +20,21 @@
#include <signal.h>
#include <sys/signalfd.h>
#include <sysdep.h>
+#include <kernel-features.h>
int
signalfd (int fd, const sigset_t *mask, int flags)
{
#ifdef __NR_signalfd4
- return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
-#else
+ int res = INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
+# ifndef __ASSUME_SIGNALFD4
+ if (res != -1 || errno != ENOSYS)
+# endif
+ return res;
+#endif
+
+#ifndef __ASSUME_SIGNALFD4
/* The old system call has no flag parameter which is bad. So we have
to wait until we have to support to pass additional values to the
kernel (sys_indirect) before implementing setting flags like
@@ -44,5 +51,7 @@ signalfd (int fd, const sigset_t *mask, int flags)
__set_errno (ENOSYS);
return -1;
# endif
+#elif !defined __NR_signalfd4
+# error "__ASSUME_SIGNALFD4 defined but not __NR_signalfd4"
#endif
}
diff --git a/sysdeps/unix/sysv/linux/socketcall.h b/sysdeps/unix/sysv/linux/socketcall.h
index 24ec9ee2ac..adf01b6e10 100644
--- a/sysdeps/unix/sysv/linux/socketcall.h
+++ b/sysdeps/unix/sysv/linux/socketcall.h
@@ -1,5 +1,5 @@
/* ID for functions called via socketcall system call.
- Copyright (C) 1995, 1996, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2008, 2009 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
@@ -43,6 +43,6 @@
#define SOCKOP_getsockopt 15
#define SOCKOP_sendmsg 16
#define SOCKOP_recvmsg 17
-#define SOCKOP_paccept 18
+#define SOCKOP_accept4 18
#endif /* sys/socketcall.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
index d43a3cdf79..a148072095 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Linux/SPARC version.
- Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008
+ Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -94,15 +94,21 @@ enum __socket_type
#define PF_ASH 18 /* Ash. */
#define PF_ECONET 19 /* Acorn Econet. */
#define PF_ATMSVC 20 /* ATM SVCs. */
+#define PF_RDS 21 /* RDS sockets. */
#define PF_SNA 22 /* Linux SNA Project */
#define PF_IRDA 23 /* IRDA sockets. */
#define PF_PPPOX 24 /* PPPoX sockets. */
#define PF_WANPIPE 25 /* Wanpipe API sockets. */
+#define PF_LLC 26 /* Linux LLC. */
+#define PF_CAN 29 /* Controller Area Network. */
+#define PF_TIPC 30 /* TIPC sockets. */
#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
#define PF_IUCV 32 /* IUCV sockets. */
#define PF_RXRPC 33 /* RxRPC sockets. */
#define PF_ISDN 34 /* mISDN sockets. */
-#define PF_MAX 35 /* For now.. */
+#define PF_PHONET 35 /* Phonet sockets. */
+#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
+#define PF_MAX 37 /* For now.. */
/* Address families. */
#define AF_UNSPEC PF_UNSPEC
@@ -129,14 +135,20 @@ enum __socket_type
#define AF_ASH PF_ASH
#define AF_ECONET PF_ECONET
#define AF_ATMSVC PF_ATMSVC
+#define AF_RDS PF_RDS
#define AF_SNA PF_SNA
#define AF_IRDA PF_IRDA
#define AF_PPPOX PF_PPPOX
#define AF_WANPIPE PF_WANPIPE
+#define AF_LLC PF_LLC
+#define AF_CAN PF_CAN
+#define AF_TIPC PF_TIPC
#define AF_BLUETOOTH PF_BLUETOOTH
#define AF_IUCV PF_IUCV
#define AF_RXRPC PF_RXRPC
#define AF_ISDN PF_ISDN
+#define AF_PHONET PF_PHONET
+#define AF_IEEE802154 PF_IEEE802154
#define AF_MAX PF_MAX
/* Socket level values. Others are defined in the appropriate headers.
diff --git a/sysdeps/unix/sysv/linux/sys/epoll.h b/sysdeps/unix/sysv/linux/sys/epoll.h
index 12de0bcfe2..ca1d3d0459 100644
--- a/sysdeps/unix/sysv/linux/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/sys/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007, 2008, 2009 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/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index d8d9bc12a4..33e6115f7b 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -107,7 +107,8 @@ _dl_runtime_profile:
movaps %xmm3, 112(%rsp)
movaps %xmm4, 128(%rsp)
movaps %xmm5, 144(%rsp)
- movaps %xmm7, 160(%rsp)
+ movaps %xmm6, 160(%rsp)
+ movaps %xmm7, 176(%rsp)
movq %rsp, %rcx # La_x86_64_regs pointer to %rcx.
movq 48(%rbx), %rdx # Load return address if needed.
@@ -128,7 +129,8 @@ _dl_runtime_profile:
movaps 112(%rsp), %xmm3
movaps 128(%rsp), %xmm4
movaps 144(%rsp), %xmm5
- movaps 160(%rsp), %xmm7
+ movaps 160(%rsp), %xmm6
+ movaps 176(%rsp), %xmm7
movq 16(%rbx), %r10 # Anything in framesize?
testq %r10, %r10
diff --git a/sysdeps/x86_64/memchr.S b/sysdeps/x86_64/memchr.S
index 54b7af534c..6082aa7f76 100644
--- a/sysdeps/x86_64/memchr.S
+++ b/sysdeps/x86_64/memchr.S
@@ -41,7 +41,7 @@ ENTRY (memchr)
movl $16, %esi
jnz 1f
cmpq %rsi, %rdx
- jle 3f
+ jbe 3f
2: movdqa (%rdi,%rsi), %xmm0
leaq 16(%rsi), %rsi
@@ -50,7 +50,7 @@ ENTRY (memchr)
testl %ecx, %ecx
jnz 1f
cmpq %rsi, %rdx
- jg 2b
+ ja 2b
3: xorl %eax, %eax
ret
@@ -60,7 +60,7 @@ ENTRY (memchr)
addq %rcx, %rax
leaq -16(%rsi,%rcx), %rsi
cmpq %rsi, %rdx
- jle 3b
+ jbe 3b
ret
END (memchr)