summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-osinfo.h48
-rw-r--r--sysdeps/generic/ldsodefs.h5
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps7
-rw-r--r--sysdeps/i386/stackinfo.h12
-rw-r--r--sysdeps/powerpc/fpu/tst-setcontext-fpscr.c10
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S6
-rw-r--r--sysdeps/powerpc/powerpc64/__longjmp-common.S7
-rw-r--r--sysdeps/unix/sysv/linux/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/dl-osinfo.h96
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysconf.c14
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/shm.h9
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S9
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S25
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/sh/Makefile5
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.h6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/sys/inotify.h4
-rw-r--r--sysdeps/unix/sysv/linux/tst-clone.c6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/shm.h3
-rw-r--r--sysdeps/x86_64/cacheinfo.c14
-rw-r--r--sysdeps/x86_64/stackinfo.h12
24 files changed, 227 insertions, 86 deletions
diff --git a/sysdeps/generic/dl-osinfo.h b/sysdeps/generic/dl-osinfo.h
index 60b84a900d..4b880dae34 100644
--- a/sysdeps/generic/dl-osinfo.h
+++ b/sysdeps/generic/dl-osinfo.h
@@ -1,12 +1,48 @@
+/* Operating system specific code for generic dynamic loader functions.
+ Copyright (C) 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
+ 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 <stdint.h>
static inline uintptr_t __attribute__ ((always_inline))
-_dl_setup_stack_chk_guard (void)
+_dl_setup_stack_chk_guard (void *dl_random)
+{
+ uintptr_t ret;
+ if (dl_random == NULL)
+ {
+ ret = 0;
+ unsigned char *p = (unsigned char *) &ret;
+ p[sizeof (ret) - 1] = 255;
+ p[sizeof (ret) - 2] = '\n';
+ p[0] = 0;
+ }
+ else
+ memcpy (&ret, dl_random, sizeof (ret));
+ return ret;
+}
+
+static inline uintptr_t __attribute__ ((always_inline))
+_dl_setup_pointer_guard (void *dl_random, uintptr_t stack_chk_guard)
{
- uintptr_t ret = 0;
- unsigned char *p = (unsigned char *) &ret;
- p[sizeof (ret) - 1] = 255;
- p[sizeof (ret) - 2] = '\n';
- p[0] = 0;
+ uintptr_t ret;
+ if (dl_random == NULL)
+ ret = stack_chk_guard;
+ else
+ memcpy (&ret, (char *) dl_random + sizeof (ret), sizeof (ret));
return ret;
}
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 4d857404a3..e00b173f49 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
@@ -731,6 +731,9 @@ weak_extern (_dl_starting_up)
extern int _dl_starting_up_internal attribute_hidden;
#endif
+/* Random data provided by the kernel. */
+extern void *_dl_random attribute_hidden;
+
/* OS-dependent function to open the zero-fill device. */
extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index 4efc714b29..5231789be1 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -453,6 +453,10 @@ Test "exp10 (3) == 1000":
ildouble: 8
ldouble: 8
+# expm1
+Test "expm1 (1) == M_El - 1.0":
+ildouble: 1
+
# gamma
Test "gamma (-0.5) == log(2*sqrt(pi))":
double: 1
@@ -1134,6 +1138,9 @@ Function: "exp10":
ildouble: 8
ldouble: 8
+Function: "expm1":
+ildouble: 1
+
Function: "gamma":
double: 1
idouble: 1
diff --git a/sysdeps/i386/stackinfo.h b/sysdeps/i386/stackinfo.h
index a9a6745aaf..2530ea7234 100644
--- a/sysdeps/i386/stackinfo.h
+++ b/sysdeps/i386/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 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,4 +25,14 @@
/* On x86 the stack grows down. */
#define _STACK_GROWS_DOWN 1
+/* Access to the stack pointer. The macros are used in alloca_account
+ for which they need to act as barriers as well, hence the additional
+ (unnecessary) parameters. */
+#define stackinfo_get_sp() \
+ ({ void *p__; asm volatile ("mov %%esp, %0" : "=r" (p__)); p__; })
+#define stackinfo_sub_sp(ptr) \
+ ({ ptrdiff_t d__; \
+ asm volatile ("sub %%esp, %0" : "=r" (d__) : "0" (ptr)); \
+ d__; })
+
#endif /* stackinfo.h */
diff --git a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
index 973fb3f77a..a15fe86fb9 100644
--- a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
+++ b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2002,2004,2006,2007,2008 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2002,2004,2006-2008,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ryan S. Arnold <rsa@us.ibm.com>
Sean Curry <spcurry@us.ibm.com>
@@ -104,12 +104,16 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
(__fpscr)=tmp.fpscr; \
tmp.fpscr; })
+/* We make sure to zero fp0 after we use it in order to prevent stale data
+ in an fp register from making a test-case pass erroneously. */
# define _SET_DI_FPSCR(__fpscr) { \
union { double d; di_fpscr_t fpscr; } \
tmp __attribute__ ((__aligned__(8))); \
tmp.fpscr = __fpscr; \
/* Set the entire 64-bit FPSCR. */ \
__asm__ ("lfd%U0 0,%0; mtfsf 255,0,1,0" : : "m" (tmp.d) : "fr0"); \
+ tmp.d = 0; \
+ __asm__("lfd%U0 0,%0" : : "m" (tmp.d) : "fr0"); \
}
# define _GET_SI_FPSCR(__fpscr) ({ \
@@ -120,6 +124,8 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
(__fpscr)=tmp.cw[1]; \
tmp.cw[0]; })
+/* We make sure to zero fp0 after we use it in order to prevent stale data
+ in an fp register from making a test-case pass erroneously. */
# define _SET_SI_FPSCR(__fpscr) { \
union { double d; si_fpscr_t fpscr[2]; } \
tmp __attribute__ ((__aligned__(8))); \
@@ -127,6 +133,8 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
tmp.fpscr[0] = 0xFFF80000; \
tmp.fpscr[1] = __fpscr; \
__asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0"); \
+ tmp.d = 0; \
+ __asm__("lfd%U0 0,%0" : : "m" (tmp.d) : "fr0"); \
}
void prime_special_regs(int which)
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 7c6e27c209..f9f010fcac 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -1,5 +1,5 @@
/* longjmp for PowerPC.
- Copyright (C) 1995-99, 2000, 2003-2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-99, 2000, 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
@@ -64,7 +64,7 @@ ENTRY (BP_SYM (__longjmp))
andi. r6,r5,0xf
lwz r0,((JB_VRSAVE)*4)(3)
mtspr VRSAVE,r0
- beq+ aligned_restore_vmx
+ beq+ L(aligned_restore_vmx)
addi r6,r5,16
lvsl v0,0,r5
lvx v1,0,r5
@@ -88,7 +88,7 @@ ENTRY (BP_SYM (__longjmp))
lvx v1,0,r5
vperm v31,v31,v1,v0
b L(no_vmx)
-aligned_restore_vmx:
+L(aligned_restore_vmx):
addi r6,r5,16
lvx v20,0,r5
addi r5,r5,32
diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S
index 700a2a543c..19b2849c01 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S
@@ -1,6 +1,5 @@
/* longjmp for PowerPC64.
- Copyright (C) 1995, 1996,1997,1999,2000,2001,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996,1997,1999-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
@@ -58,7 +57,7 @@ ENTRY (BP_SYM (__longjmp))
andi. r6,r5,0xf
lwz r0,((JB_VRSAVE)*8)(3)
mtspr VRSAVE,r0
- beq+ aligned_restore_vmx
+ beq+ L(aligned_restore_vmx)
addi r6,r5,16
lvsl v0,0,r5
lvx v1,0,r5
@@ -82,7 +81,7 @@ ENTRY (BP_SYM (__longjmp))
lvx v1,0,r5
vperm v31,v31,v1,v0
b L(no_vmx)
-aligned_restore_vmx:
+L(aligned_restore_vmx):
addi r6,r5,16
lvx v20,0,r5
addi r5,r5,32
diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h
index 3f63152304..90ad0c718f 100644
--- a/sysdeps/unix/sysv/linux/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,2000,2002,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,2000,2002,2004,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
@@ -30,6 +30,7 @@
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index 275a0730c8..9fcfd47829 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -1,5 +1,5 @@
/* Operating system specific code for generic dynamic loader functions. Linux.
- Copyright (C) 2000-2002,2004-2007,2008 Free Software Foundation, Inc.
+ Copyright (C) 2000-2002,2004-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
@@ -63,48 +63,78 @@ dl_fatal (const char *str)
} while (0)
static inline uintptr_t __attribute__ ((always_inline))
-_dl_setup_stack_chk_guard (void)
+_dl_setup_stack_chk_guard (void *dl_random)
{
uintptr_t ret;
-#ifdef ENABLE_STACKGUARD_RANDOMIZE
- int fd = __open ("/dev/urandom", O_RDONLY);
- if (fd >= 0)
+#ifndef __ASSUME_AT_RANDOM
+ if (__builtin_expect (dl_random == NULL, 0))
{
- ssize_t reslen = __read (fd, &ret, sizeof (ret));
- __close (fd);
- if (reslen == (ssize_t) sizeof (ret))
- return ret;
- }
-#endif
- ret = 0;
- unsigned char *p = (unsigned char *) &ret;
- p[sizeof (ret) - 1] = 255;
- p[sizeof (ret) - 2] = '\n';
+# ifdef ENABLE_STACKGUARD_RANDOMIZE
+ int fd = __open ("/dev/urandom", O_RDONLY);
+ if (fd >= 0)
+ {
+ ssize_t reslen = __read (fd, &ret, sizeof (ret));
+ __close (fd);
+ if (reslen == (ssize_t) sizeof (ret))
+ return ret;
+ }
+# endif
+ ret = 0;
+ unsigned char *p = (unsigned char *) &ret;
+ p[sizeof (ret) - 1] = 255;
+ p[sizeof (ret) - 2] = '\n';
#ifdef HP_TIMING_NOW
- hp_timing_t hpt;
- HP_TIMING_NOW (hpt);
- hpt = (hpt & 0xffff) << 8;
- ret ^= hpt;
+ hp_timing_t hpt;
+ HP_TIMING_NOW (hpt);
+ hpt = (hpt & 0xffff) << 8;
+ ret ^= hpt;
#endif
- uintptr_t stk;
- /* Avoid GCC being too smart. */
- asm ("" : "=r" (stk) : "r" (p));
- stk &= 0x7ffff0;
+ uintptr_t stk;
+ /* Avoid GCC being too smart. */
+ asm ("" : "=r" (stk) : "r" (p));
+ stk &= 0x7ffff0;
#if __BYTE_ORDER == __LITTLE_ENDIAN
- stk <<= (__WORDSIZE - 23);
+ stk <<= (__WORDSIZE - 23);
#elif __WORDSIZE == 64
- stk <<= 31;
+ stk <<= 31;
#endif
- ret ^= stk;
- /* Avoid GCC being too smart. */
- p = (unsigned char *) &errno;
- asm ("" : "=r" (stk) : "r" (p));
- stk &= 0x7fff00;
+ ret ^= stk;
+ /* Avoid GCC being too smart. */
+ p = (unsigned char *) &errno;
+ asm ("" : "=r" (stk) : "r" (p));
+ stk &= 0x7fff00;
#if __BYTE_ORDER == __LITTLE_ENDIAN
- stk <<= (__WORDSIZE - 29);
+ stk <<= (__WORDSIZE - 29);
#else
- stk >>= 8;
+ stk >>= 8;
+#endif
+ ret ^= stk;
+ }
+ else
+#endif
+ /* We need in the moment only 8 bytes on 32-bit platforms and 16
+ bytes on 64-bit platforms. Therefore we can use the data
+ directly and not use the kernel-provided data to seed a PRNG. */
+ memcpy (&ret, dl_random, sizeof (ret));
+ return ret;
+}
+
+static inline uintptr_t __attribute__ ((always_inline))
+_dl_setup_pointer_guard (void *dl_random, uintptr_t stack_chk_guard)
+{
+ uintptr_t ret;
+#ifndef __ASSUME_AT_RANDOM
+ if (dl_random == NULL)
+ {
+ ret = stack_chk_guard;
+# ifndef HP_TIMING_NONAVAIL
+ hp_timing_t now;
+ HP_TIMING_NOW (now);
+ ret ^= now;
+# endif
+ }
+ else
#endif
- ret ^= stk;
+ memcpy (&ret, (char *) dl_random + sizeof (ret), sizeof (ret));
return ret;
}
diff --git a/sysdeps/unix/sysv/linux/i386/sysconf.c b/sysdeps/unix/sysv/linux/i386/sysconf.c
index 38bb5337ba..b1c93d7359 100644
--- a/sysdeps/unix/sysv/linux/i386/sysconf.c
+++ b/sysdeps/unix/sysv/linux/i386/sysconf.c
@@ -76,8 +76,10 @@ static const struct intel_02_cache_info
{
{ 0x06, _SC_LEVEL1_ICACHE_SIZE, 8192, 4, 32 },
{ 0x08, _SC_LEVEL1_ICACHE_SIZE, 16384, 4, 32 },
+ { 0x09, _SC_LEVEL1_ICACHE_SIZE, 32768, 4, 32 },
{ 0x0a, _SC_LEVEL1_DCACHE_SIZE, 8192, 2, 32 },
{ 0x0c, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 32 },
+ { 0x0d, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 64 },
{ 0x22, _SC_LEVEL3_CACHE_SIZE, 524288, 4, 64 },
{ 0x23, _SC_LEVEL3_CACHE_SIZE, 1048576, 8, 64 },
{ 0x25, _SC_LEVEL3_CACHE_SIZE, 2097152, 8, 64 },
@@ -122,6 +124,18 @@ static const struct intel_02_cache_info
{ 0x85, _SC_LEVEL2_CACHE_SIZE, 2097152, 8, 32 },
{ 0x86, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 64 },
{ 0x87, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
+ { 0xd0, _SC_LEVEL3_CACHE_SIZE, 524288, 4, 64 },
+ { 0xd1, _SC_LEVEL3_CACHE_SIZE, 1048576, 4, 64 },
+ { 0xd2, _SC_LEVEL3_CACHE_SIZE, 2097152, 4, 64 },
+ { 0xd6, _SC_LEVEL3_CACHE_SIZE, 1048576, 8, 64 },
+ { 0xd7, _SC_LEVEL3_CACHE_SIZE, 2097152, 8, 64 },
+ { 0xd8, _SC_LEVEL3_CACHE_SIZE, 4194304, 8, 64 },
+ { 0xdc, _SC_LEVEL3_CACHE_SIZE, 2097152, 12, 64 },
+ { 0xdd, _SC_LEVEL3_CACHE_SIZE, 4194304, 12, 64 },
+ { 0xde, _SC_LEVEL3_CACHE_SIZE, 8388608, 12, 64 },
+ { 0xe3, _SC_LEVEL3_CACHE_SIZE, 2097152, 16, 64 },
+ { 0xe3, _SC_LEVEL3_CACHE_SIZE, 4194304, 16, 64 },
+ { 0xe4, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
};
#define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known[0]))
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/shm.h b/sysdeps/unix/sysv/linux/ia64/bits/shm.h
index 2dc58a679d..71b85295c5 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2005, 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
@@ -30,6 +30,7 @@
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/shm.h b/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
index 6a35ff1d7c..023de7990d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -28,9 +28,10 @@
#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
/* Flags for `shmat'. */
-#define SHM_RDONLY 010000 /* attach read-only else read-write */
-#define SHM_RND 020000 /* round attach address to SHMLBA */
-#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index 91ac4366c0..d83a0ef28d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -1,5 +1,5 @@
/* Jump to a new context powerpc32 common.
- Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 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
@@ -18,13 +18,13 @@
02110-1301 USA. */
/* This is the common implementation of setcontext for powerpc32.
- It not complete in itself should be included in to a framework that
+ It not complete in itself should be included in to a framework that
defines:
__CONTEXT_FUNC_NAME
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any archecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
@@ -202,7 +202,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
lfd fp0,_UC_FREGS+(0*8)(r31)
# ifdef _ARCH_PWR6
/* Use the extended four-operand version of the mtfsf insn. */
- mtfsf 0xff,fp0,1,0
+ mtfsf 0xff,fp31,1,0
# else
/* Availability of DFP indicates a 64-bit FPSCR. */
andi. r6,r7,PPC_FEATURE_HAS_DFP
@@ -304,4 +304,3 @@ ENTRY(__CONTEXT_FUNC_NAME)
/* NOTREACHED */
END (__CONTEXT_FUNC_NAME)
-
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 77c982242a..243a66a0d4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -1,5 +1,5 @@
/* Save current context and jump to a new context.
- Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 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
@@ -18,13 +18,13 @@
02110-1301 USA. */
/* This is the common implementation of setcontext for powerpc32.
- It not complete in itself should be included in to a framework that
+ It not complete in itself should be included in to a framework that
defines:
__CONTEXT_FUNC_NAME
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any archecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
@@ -51,7 +51,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
stw r0,_UC_GREGS+(PT_R0*4)(r3)
mflr r0
stw r2,_UC_GREGS+(PT_R2*4)(r3)
- stw r4,_UC_GREGS+(PT_R4*4)(r3)
+ stw r4,_UC_GREGS+(PT_R4*4)(r3)
/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
return address. */
stw r0,_UC_GREGS+(PT_LNK*4)(r3)
@@ -85,7 +85,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
stw r29,_UC_GREGS+(PT_R29*4)(r3)
stw r30,_UC_GREGS+(PT_R30*4)(r3)
stw r31,_UC_GREGS+(PT_R31*4)(r3)
-
+
/* Save the value of R1. We had to push the stack before we
had the address of uc_reg_space. So compute the address of
the callers stack pointer and save it as R1. */
@@ -174,10 +174,10 @@ ENTRY(__CONTEXT_FUNC_NAME)
la r10,(_UC_VREGS)(r3)
la r9,(_UC_VREGS+16)(r3)
-
+
/* beq L(no_vec)*/
beq 2f
-/* address of the combined VSCR/VSAVE quadword. */
+/* address of the combined VSCR/VSAVE quadword. */
la r8,(_UC_VREGS+512)(r3)
/* Save the vector registers */
@@ -194,7 +194,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
stvx v3,0,r9
addi r10,r10,32
addi r9,r9,32
-
+
stvx v0,0,r8
stvx v4,0,r10
@@ -266,7 +266,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
stvx v30,0,r10
stvx v31,0,r9
stw r0,0(r8)
-
+
2: /*L(no_vec):*/
# endif /* __CONTEXT_ENABLE_VRS */
#endif /* __CONTEXT_ENABLE_FPRS */
@@ -428,7 +428,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
lfd fp0,_UC_FREGS+(0*8)(r31)
# ifdef _ARCH_PWR6
/* Use the extended four-operand version of the mtfsf insn. */
- mtfsf 0xff,fp0,1,0
+ mtfsf 0xff,fp31,1,0
# else
/* Availability of DFP indicates a 64-bit FPSCR. */
andi. r6,r7,PPC_FEATURE_HAS_DFP
@@ -514,13 +514,13 @@ ENTRY(__CONTEXT_FUNC_NAME)
lwz r31,_UC_GREGS+(PT_R31*4)(r31)
bctr
-
+
3:/*L(error_exit):*/
lwz r0,_FRAME_LR_SAVE+16(r1)
addi r1,r1,16
mtlr r0
blr
-
+
4:/*L(do_sigret):*/
addi r1,r4,-0xd0
li r0,SYS_ify(rt_sigreturn)
@@ -528,4 +528,3 @@ ENTRY(__CONTEXT_FUNC_NAME)
/* NOTREACHED */
END(__CONTEXT_FUNC_NAME)
-
diff --git a/sysdeps/unix/sysv/linux/s390/bits/shm.h b/sysdeps/unix/sysv/linux/s390/bits/shm.h
index a6df6d779d..e31a29fcd7 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2004, 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,6 +31,7 @@
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/unix/sysv/linux/sh/Makefile b/sysdeps/unix/sysv/linux/sh/Makefile
index c1b436a6fb..1ead8f2ae3 100644
--- a/sysdeps/unix/sysv/linux/sh/Makefile
+++ b/sysdeps/unix/sysv/linux/sh/Makefile
@@ -5,3 +5,8 @@ endif
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif
+
+ifeq ($(subdir),math)
+# The libm.so link can't find __fpscr_values
+libm.so-no-z-defs = yes
+endif
diff --git a/sysdeps/unix/sysv/linux/sh/bits/shm.h b/sysdeps/unix/sysv/linux/sh/bits/shm.h
index 709aa3f976..6469784983 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,2000,2002,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,2000,2002,2004,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
@@ -30,6 +30,7 @@
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h
index f0be37edc8..0fc2c4f1ee 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -1,5 +1,5 @@
/* Copyright (C) 1992,1993,1995,1996,1997,1998,1999,2000,2002,2003,2004,
- 2005,2006 Free Software Foundation, Inc.
+ 2005,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@@ -339,7 +339,7 @@
asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD \
: "=z" (resultvar) \
: "r" (r3) ASMFMT_##nr \
- : "memory"); \
+ : "memory", "t"); \
\
(int) resultvar; })
@@ -353,7 +353,7 @@
asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD \
: "=z" (resultvar) \
: "r" (r3) ASMFMT_##nr \
- : "memory"); \
+ : "memory", "t"); \
\
(int) resultvar; })
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/shm.h b/sysdeps/unix/sysv/linux/sparc/bits/shm.h
index 273b67edb5..1ec5e91322 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -32,6 +32,7 @@
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h
index 81e31fb646..8b3a85280f 100644
--- a/sysdeps/unix/sysv/linux/sys/inotify.h
+++ b/sysdeps/unix/sysv/linux/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 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
@@ -98,7 +98,7 @@ extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
__THROW;
/* Remove the watch specified by WD from the inotify instance FD. */
-extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+extern int inotify_rm_watch (int __fd, int __wd) __THROW;
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/tst-clone.c b/sysdeps/unix/sysv/linux/tst-clone.c
index 8e249c2f04..cbfa8917d6 100644
--- a/sysdeps/unix/sysv/linux/tst-clone.c
+++ b/sysdeps/unix/sysv/linux/tst-clone.c
@@ -1,5 +1,5 @@
/* Test for proper error/errno handling in clone.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -36,9 +36,9 @@ do_test (void)
int result;
#ifdef __ia64__
- result = __clone2(child_fn, NULL, 0, 0, NULL, NULL, NULL);
+ result = __clone2 (child_fn, NULL, 0, 0, NULL, NULL, NULL);
#else
- result = clone(child_fn, NULL, (int) NULL, NULL);
+ result = clone (child_fn, NULL, 0, NULL);
#endif
if (errno != EINVAL || result != -1)
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/shm.h b/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
index def200c193..04f5cc5d65 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -31,6 +31,7 @@
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86_64/cacheinfo.c
index 6a3ea0f1cb..a7e3fc7633 100644
--- a/sysdeps/x86_64/cacheinfo.c
+++ b/sysdeps/x86_64/cacheinfo.c
@@ -34,8 +34,10 @@ static const struct intel_02_cache_info
{
{ 0x06, _SC_LEVEL1_ICACHE_SIZE, 8192, 4, 32 },
{ 0x08, _SC_LEVEL1_ICACHE_SIZE, 16384, 4, 32 },
+ { 0x09, _SC_LEVEL1_ICACHE_SIZE, 32768, 4, 32 },
{ 0x0a, _SC_LEVEL1_DCACHE_SIZE, 8192, 2, 32 },
{ 0x0c, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 32 },
+ { 0x0d, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 64 },
{ 0x22, _SC_LEVEL3_CACHE_SIZE, 524288, 4, 64 },
{ 0x23, _SC_LEVEL3_CACHE_SIZE, 1048576, 8, 64 },
{ 0x25, _SC_LEVEL3_CACHE_SIZE, 2097152, 8, 64 },
@@ -80,6 +82,18 @@ static const struct intel_02_cache_info
{ 0x85, _SC_LEVEL2_CACHE_SIZE, 2097152, 8, 32 },
{ 0x86, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 64 },
{ 0x87, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
+ { 0xd0, _SC_LEVEL3_CACHE_SIZE, 524288, 4, 64 },
+ { 0xd1, _SC_LEVEL3_CACHE_SIZE, 1048576, 4, 64 },
+ { 0xd2, _SC_LEVEL3_CACHE_SIZE, 2097152, 4, 64 },
+ { 0xd6, _SC_LEVEL3_CACHE_SIZE, 1048576, 8, 64 },
+ { 0xd7, _SC_LEVEL3_CACHE_SIZE, 2097152, 8, 64 },
+ { 0xd8, _SC_LEVEL3_CACHE_SIZE, 4194304, 8, 64 },
+ { 0xdc, _SC_LEVEL3_CACHE_SIZE, 2097152, 12, 64 },
+ { 0xdd, _SC_LEVEL3_CACHE_SIZE, 4194304, 12, 64 },
+ { 0xde, _SC_LEVEL3_CACHE_SIZE, 8388608, 12, 64 },
+ { 0xe3, _SC_LEVEL3_CACHE_SIZE, 2097152, 16, 64 },
+ { 0xe3, _SC_LEVEL3_CACHE_SIZE, 4194304, 16, 64 },
+ { 0xe4, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
};
#define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known [0]))
diff --git a/sysdeps/x86_64/stackinfo.h b/sysdeps/x86_64/stackinfo.h
index 60668d10b1..b11849d9ab 100644
--- a/sysdeps/x86_64/stackinfo.h
+++ b/sysdeps/x86_64/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 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,4 +25,14 @@
/* On x86_64 the stack grows down. */
#define _STACK_GROWS_DOWN 1
+/* Access to the stack pointer. The macros are used in alloca_account
+ for which they need to act as barriers as well, hence the additional
+ (unnecessary) parameters. */
+#define stackinfo_get_sp() \
+ ({ void *p__; asm volatile ("mov %%rsp, %0" : "=r" (p__)); p__; })
+#define stackinfo_sub_sp(ptr) \
+ ({ ptrdiff_t d__; \
+ asm volatile ("sub %%rsp, %0" : "=r" (d__) : "0" (ptr)); \
+ d__; })
+
#endif /* stackinfo.h */