From 1f09da09fed864c91288ff91295114fa5202edaa Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 19 Dec 2006 19:05:41 +0000 Subject: Updated to fedora-glibc-20061219T1804 --- ChangeLog | 67 ++++++++++-- ChangeLog.11 | 21 ---- ChangeLog.12 | 12 --- ChangeLog.15 | 8 -- elf/dl-support.c | 1 + fedora/branch.mk | 4 +- fedora/glibc.spec.in | 10 +- misc/tst-pselect.c | 21 ++-- nss/getXXbyYY_r.c | 11 +- stdlib/Makefile | 3 +- stdlib/jrand48_r.c | 4 +- stdlib/tst-makecontext.c | 57 +++++++++++ stdlib/tst-rand48-2.c | 113 +++++++++++++++++++++ stdlib/tst-rand48.c | 28 ++--- sysdeps/powerpc/dl-procinfo.c | 13 ++- sysdeps/powerpc/dl-procinfo.h | 48 ++++++--- sysdeps/powerpc/sysdep.h | 9 +- .../sysv/linux/powerpc/powerpc32/makecontext.S | 4 +- 18 files changed, 328 insertions(+), 106 deletions(-) create mode 100644 stdlib/tst-makecontext.c create mode 100644 stdlib/tst-rand48-2.c diff --git a/ChangeLog b/ChangeLog index 11188cf9d1..474543f6d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,59 @@ +2006-12-19 Jakub Jelinek + + * nss/getXXbyYY_r.c: Include atomic.h. + (INTERNAL (REENTRANT_NAME)): Write startp after start_fct, + add atomic_write_barrier () in between. + + * stdlib/Makefile (tests): Add tst-makecontext. + * stdlib/tst-makecontext.c: New test. + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S + (__makecontext): Don't realign uc_mcontext.uc_regs. + +2006-11-28 Jakub Jelinek + + * elf/dl-support.c: Include dl-procinfo.h. + * sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4, + PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS, + PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X): + Define. + (_dl_string_platform): Use PPC_PLATFORM_* macros instead of + hardcoded constants. + * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use + PPC_PLATFORM_* macros for array designators. + +2006-11-11 Steven Munroe + + * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap + names to the beginning. + (_dl_powerpc_platforms): Add "power6x". + * sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease. + (HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP. + (_DL_PLATFORMS_COUNT): Increase. + (_dl_string_platform): Handle power6x case. + * sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP, + PPC_FEATURE_POWER6_EXT): Define. + (PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment. + +2006-12-18 Jakub Jelinek + + [BZ #3747] + * stdlib/jrand48_r.c (__jrand48_r): Make sure result is in the + [-231 .. 231) range. + * stdlib/tst-rand48.c (main): Fix expected values for 64-bit + targets. + * stdlib/tst-rand48-2.c: New test. + * stdlib/Makefile (tests): Add tst-rand48-2. + +2006-12-14 Jakub Jelinek + + * misc/tst-pselect.c (do_test): Fix sigblock argument. + +2006-12-14 Ulrich Drepper + + * misc/tst-pselect.c (do_test): Make sure the helper process is + terminating when the test is aborted. + 2006-12-13 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME. @@ -1031,17 +1087,6 @@ * sysdeps/ieee754/ldbl-128ibm/s_lrintl.c: Rewritten. * sysdeps/ieee754/ldbl-128ibm/s_lroundl.c: Rewritten. -2006-09-14 Jakub Jelinek - - * sysdeps/ieee754/ldbl-128ibm/s_llrintl.c: Comment fixes. - * sysdeps/ieee754/ldbl-128ibm/s_llroundl.c: Comment fixes. - * sysdeps/ieee754/ldbl-128ibm/s_lrintl.c: Rewritten. - * sysdeps/ieee754/ldbl-128ibm/s_lroundl.c: Rewritten. - - * io/Makefile (CFLAGS-fstatat.c): Set. - (CFLAGS-fstatat64.c): Likewise. - (CFLAGS-mknodat.c): Likewise. - 2006-09-14 Jakub Jelinek Steven Munroe diff --git a/ChangeLog.11 b/ChangeLog.11 index f2f274f3eb..d9b0364361 100644 --- a/ChangeLog.11 +++ b/ChangeLog.11 @@ -1352,11 +1352,6 @@ * sysdeps/unix/sysv/linux/mips/sys/tas.h: Add missing .mips0 at the end of inline assembler code. -2000-10-02 Jakub Jelinek - - * sunrpc/svc_udp.c (svcudp_recv): Set msg_controllen to all - remaining xp_pad space. - 2000-10-02 Ulrich Drepper * include/features.h [__USE_FILE_OFFSET && !__REDIRECT]: Define @@ -9285,12 +9280,6 @@ syscall. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise. -2000-05-30 Jakub Jelinek - - * resolv/res_query.c (res_nsearch): Remove unused variable - root_on_list. If dots >= statp->ndots and as is querydomain - fails, keep searching. - 2000-05-30 Ulrich Drepper * sysdeps/unix/sysv/linux/alpha/oldglob.c (__old_glob): Loose __P. @@ -9491,11 +9480,6 @@ * sysdeps/i386/fpu/bits/mathinline.h: Define expm1 inline only if __FAST_MATH__ is defined. -2000-05-22 Jakub Jelinek - - * sysdeps/i386/fpu/bits/mathinline.h (__expm1_code): Avoid using ?: - with omitted middle operand. - 2000-05-22 Andreas Jaeger * math/Makefile: Add -D__FAST_MATH__ to CFLAGS-test-ifloat.c, @@ -9734,11 +9718,6 @@ * manual/arith.texi (Parsing of Integers): Fix typo. Closes PR libc/1744, reported by blp@gnu.org. -2000-05-17 Jakub Jelinek - - * inet/rcmd.c (rcmd_af): If *ahost cannot be resolved, include - unresolved hostname in the message. - 2000-05-17 Jakub Jelinek * sysdeps/arm/bits/huge_val.h (HUGE_VAL, HUGE_VALF): Add diff --git a/ChangeLog.12 b/ChangeLog.12 index 9f1981ebc7..2a4620e56d 100644 --- a/ChangeLog.12 +++ b/ChangeLog.12 @@ -7729,13 +7729,6 @@ * Versions.def [ld]: Add GLIBC_2.2.1. -2001-01-10 Jakub Jelinek - - * malloc/memusage.c (me): If not SUID/SGID, allow creating new - $MEMUSAGE_OUTPUT file. - * sysdeps/generic/segfault.c (segfault.c): If not SUID/SGID, allow - creating new $SEGFAULT_OUTPUT_NAME file. - 2001-01-10 H.J. Lu * elf/dl-libc.c (do_dlopen): Call DL_STATIC_INIT for static binaries. @@ -8137,11 +8130,6 @@ * sysdeps/powerpc/soft-fp/Versions: Likewise. * sysdeps/sparc/sparc64/soft-fp/Versions: Likewise. -2001-01-02 Jakub Jelinek - - * locale/setlocale.c (setlocale): Don't allocate/free category name - unnecessarily. - 2001-01-02 Franz Sirl * sysdeps/powerpc/dl-machine.c (__process_machine_rela): Fix typo. diff --git a/ChangeLog.15 b/ChangeLog.15 index 300989ab4c..8082430164 100644 --- a/ChangeLog.15 +++ b/ChangeLog.15 @@ -1115,9 +1115,6 @@ * include/features.h (__USE_FORTIFY_LEVEL): Also set for Red Hat GCC 3.4.x-RH >= 3.4.2-8. - * libio/bits/features.h (printf, fprintf, vprintf, vfprintf): For - GCC 3.4.x-RH use __builtin___{,v}{,f}printf_chk instead of - __{,v}{,f}printf_chk. * debug/tst-chk1.c (do_test): Deal with GCC 3.4.x-RH not being able to recognize subobjects. @@ -1416,11 +1413,6 @@ * posix/execvp.c (execvp): Also ignore ENODEV and ETIMEDOUT errno values. -2004-10-20 Jakub Jelinek - - * sysdeps/unix/sysv/linux/readonly-area.c (__readonly_area): If /proc - is not mounted, return 1. - 2004-10-20 Roland McGrath * Makeconfig ($(common-objpfx)shlib-versions.v.i): Check also diff --git a/elf/dl-support.c b/elf/dl-support.c index fe8c68c9e4..c1cfc0df41 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/fedora/branch.mk b/fedora/branch.mk index 3548ef2413..7e8e9318e6 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora glibc-base := HEAD DIST_BRANCH := devel COLLECTION := dist-fc7 -fedora-sync-date := 2006-12-14 08:50 UTC -fedora-sync-tag := fedora-glibc-20061214T0850 +fedora-sync-date := 2006-12-19 18:04 UTC +fedora-sync-tag := fedora-glibc-20061219T1804 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index 1233cba3b1..95d9ec51e7 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 13 +%define glibcrelease 14 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define xenarches i686 athlon %ifarch %{xenarches} @@ -1544,10 +1544,16 @@ rm -f *.filelist* %endif %changelog +* Tue Dec 19 2006 Jakub Jelinek 2.5.90-14 +- fix {j,m}rand48{,_r} on 64-bit arches (BZ#3747) +- handle power6x AT_PLATFORM (#216970) +- fix a race condition in getXXbyYY_r (#219145) +- fix tst-pselect testcase + * Thu Dec 14 2006 Jakub Jelinek 2.5.90-13 - fix setcontext on ppc32 (#219107) - fix wide stdio after setvbuf (#217064, BZ#2337) -- handle realtime mount option in statvfs +- handle relatime mount option in statvfs - revert i?86/x86_64 clone CFI temporarily * Sun Dec 10 2006 Jakub Jelinek 2.5.90-12 diff --git a/misc/tst-pselect.c b/misc/tst-pselect.c index 123c31912e..35d51d8ee0 100644 --- a/misc/tst-pselect.c +++ b/misc/tst-pselect.c @@ -29,7 +29,16 @@ do_test (void) return 1; } - if (sigblock (SIGUSR1) != 0) + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_NOCLDWAIT; + + if (sigaction (SIGCHLD, &sa, NULL) != 0) + { + puts ("2nd sigaction failed"); + return 1; + } + + if (sigblock (sigmask (SIGUSR1)) != 0) { puts ("sigblock failed"); return 1; @@ -52,6 +61,7 @@ do_test (void) struct timespec to = { .tv_sec = 0, .tv_nsec = 500000000 }; + pid_t parent = getpid (); pid_t p = fork (); if (p == 0) { @@ -63,6 +73,9 @@ do_test (void) int e; do { + if (getppid () != parent) + exit (2); + errno = 0; e = pselect (fds[0][0] + 1, &rfds, NULL, NULL, &to, &ss); } @@ -108,12 +121,6 @@ do_test (void) return 1; } - if (TEMP_FAILURE_RETRY (waitpid (p, NULL, 0)) != p) - { - puts ("waitpid failed"); - return 1; - } - return 0; } diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c index 34c305f3b2..080163aac9 100644 --- a/nss/getXXbyYY_r.c +++ b/nss/getXXbyYY_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1996-2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -18,6 +18,7 @@ 02111-1307 USA. */ #include +#include #include #include #include "nsswitch.h" @@ -173,9 +174,6 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, startp = (service_user *) -1l; else { - startp = nip; - start_fct = fct.l; - #ifdef NEED__RES /* The resolver code will really be used so we have to initialize it. */ @@ -190,6 +188,11 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, if (!_res_hconf.initialized) _res_hconf_init (); #endif /* need _res_hconf */ + + start_fct = fct.l; + /* Make sure start_fct is written before startp. */ + atomic_write_barrier (); + startp = nip; } } else diff --git a/stdlib/Makefile b/stdlib/Makefile index 64a237f820..2699ca61f6 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -67,7 +67,8 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \ tst-xpg-basename tst-random tst-random2 tst-bsearch \ tst-limits tst-rand48 bug-strtod tst-setcontext \ test-a64l tst-qsort tst-system testmb2 bug-strtod2 \ - tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 + tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \ + tst-makecontext include ../Makeconfig diff --git a/stdlib/jrand48_r.c b/stdlib/jrand48_r.c index 2383ae129e..39e8d090a6 100644 --- a/stdlib/jrand48_r.c +++ b/stdlib/jrand48_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 1998, 2001, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -30,7 +30,7 @@ __jrand48_r (xsubi, buffer, result) return -1; /* Store the result. */ - *result = ((xsubi[2] << 16) | xsubi[1]) & 0xffffffffl; + *result = (int32_t) ((xsubi[2] << 16) | xsubi[1]); return 0; } diff --git a/stdlib/tst-makecontext.c b/stdlib/tst-makecontext.c new file mode 100644 index 0000000000..cbce71fb92 --- /dev/null +++ b/stdlib/tst-makecontext.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +ucontext_t ucp; +char st1[8192]; +__thread int thr; + +void +cf (int i) +{ + if (i != 78 || thr != 94) + { + printf ("i %d thr %d\n", i, thr); + exit (1); + } + exit (0); +} + +int +main (void) +{ + if (getcontext (&ucp) != 0) + { + puts ("getcontext failed"); + return 1; + } + thr = 94; + ucp.uc_link = NULL; + ucp.uc_stack.ss_sp = st1; + ucp.uc_stack.ss_size = sizeof st1; + makecontext (&ucp, (void (*) ()) cf, 1, 78); + if (setcontext (&ucp) != 0) + { + puts ("setcontext failed"); + return 1; + } + return 2; +} diff --git a/stdlib/tst-rand48-2.c b/stdlib/tst-rand48-2.c new file mode 100644 index 0000000000..3079b98839 --- /dev/null +++ b/stdlib/tst-rand48-2.c @@ -0,0 +1,113 @@ +#include +#include +#include +#include + +int +main (void) +{ + time_t t = time (NULL); + int i, ret = 0; + double d; + long int l; + struct drand48_data data; + unsigned short int buf[3]; + + srand48 ((long int) t); + for (i = 0; i < 50; i++) + if ((d = drand48 ()) < 0.0 || d >= 1.0) + { + printf ("drand48 %d %g\n", i, d); + ret = 1; + } + + srand48_r ((long int) t, &data); + for (i = 0; i < 50; i++) + if (drand48_r (&data, &d) != 0 || d < 0.0 || d >= 1.0) + { + printf ("drand48_r %d %g\n", i, d); + ret = 1; + } + + buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e; + for (i = 0; i < 50; i++) + if ((d = erand48 (buf)) < 0.0 || d >= 1.0) + { + printf ("erand48 %d %g\n", i, d); + ret = 1; + } + + buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e; + for (i = 0; i < 50; i++) + if (erand48_r (buf, &data, &d) != 0 || d < 0.0 || d >= 1.0) + { + printf ("erand48_r %d %g\n", i, d); + ret = 1; + } + + srand48 ((long int) t); + for (i = 0; i < 50; i++) + if ((l = lrand48 ()) < 0 || l > INT32_MAX) + { + printf ("lrand48 %d %ld\n", i, l); + ret = 1; + } + + srand48_r ((long int) t, &data); + for (i = 0; i < 50; i++) + if (lrand48_r (&data, &l) != 0 || l < 0 || l > INT32_MAX) + { + printf ("lrand48_r %d %ld\n", i, l); + ret = 1; + } + + buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e; + for (i = 0; i < 50; i++) + if ((l = nrand48 (buf)) < 0 || l > INT32_MAX) + { + printf ("nrand48 %d %ld\n", i, l); + ret = 1; + } + + buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e; + for (i = 0; i < 50; i++) + if (nrand48_r (buf, &data, &l) != 0 || l < 0 || l > INT32_MAX) + { + printf ("nrand48_r %d %ld\n", i, l); + ret = 1; + } + + srand48 ((long int) t); + for (i = 0; i < 50; i++) + if ((l = mrand48 ()) < INT32_MIN || l > INT32_MAX) + { + printf ("mrand48 %d %ld\n", i, l); + ret = 1; + } + + srand48_r ((long int) t, &data); + for (i = 0; i < 50; i++) + if (mrand48_r (&data, &l) != 0 || l < INT32_MIN || l > INT32_MAX) + { + printf ("mrand48_r %d %ld\n", i, l); + ret = 1; + } + + buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e; + for (i = 0; i < 50; i++) + if ((l = jrand48 (buf)) < INT32_MIN || l > INT32_MAX) + { + printf ("jrand48 %d %ld\n", i, l); + ret = 1; + } + + buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e; + for (i = 0; i < 50; i++) + if (jrand48_r (buf, &data, &l) != 0 || l < INT32_MIN || l > INT32_MAX) + { + printf ("jrand48_r %d %ld\n", i, l); + ret = 1; + } + + return ret; +} diff --git a/stdlib/tst-rand48.c b/stdlib/tst-rand48.c index fd2c4c1955..52e1b96afe 100644 --- a/stdlib/tst-rand48.c +++ b/stdlib/tst-rand48.c @@ -44,10 +44,10 @@ main (void) } l = mrand48 (); - if (l != 0xa28c1003l) + if (l != -0x5d73effdl) { printf ("mrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0xa28c1003l, l); + __LINE__ - 4, -0x5d73effdl, l); result = 1; } @@ -60,10 +60,10 @@ main (void) } l = mrand48 (); - if (l != 0x9e88f474l) + if (l != -0x61770b8cl) { printf ("mrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0x9e88f474l, l); + __LINE__ - 4, -0x61770b8cl, l); result = 1; } @@ -92,10 +92,10 @@ main (void) } l = mrand48 (); - if (l != 0xeb7a1fa3l) + if (l != -0x1485e05dl) { printf ("mrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0xeb7a1fa3l, l); + __LINE__ - 4, -0x1485e05dl, l); result = 1; } @@ -171,10 +171,10 @@ main (void) } l = mrand48 (); - if (l != 0xa28c1003l) + if (l != -0x5d73effdl) { printf ("mrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0xa28c1003l, l); + __LINE__ - 4, -0x5d73effdl, l); result = 1; } @@ -187,10 +187,10 @@ main (void) } l = mrand48 (); - if (l != 0x9e88f474l) + if (l != -0x61770b8cl) { printf ("mrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0x9e88f474l, l); + __LINE__ - 4, -0x61770b8cl, l); result = 1; } @@ -231,10 +231,10 @@ main (void) } l = mrand48 (); - if (l != 0xeb7a1fa3l) + if (l != -0x1485e05dl) { printf ("mrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0xeb7a1fa3l, l); + __LINE__ - 4, -0x1485e05dl, l); result = 1; } @@ -287,10 +287,10 @@ main (void) } l = jrand48 (xs); - if (l != 0xf568c7a0l) + if (l != -0xa973860l) { printf ("jrand48() in line %d failed: expected %lx, seen %lx\n", - __LINE__ - 4, 0xf568c7a0l, l); + __LINE__ - 4, -0xa973860l, l); result = 1; } diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c index 196f9bd65c..a732e94fa8 100644 --- a/sysdeps/powerpc/dl-procinfo.c +++ b/sysdeps/powerpc/dl-procinfo.c @@ -46,10 +46,11 @@ #if !defined PROCINFO_DECL && defined SHARED ._dl_powerpc_cap_flags #else -PROCINFO_CLASS const char _dl_powerpc_cap_flags[20][10] +PROCINFO_CLASS const char _dl_powerpc_cap_flags[23][10] #endif #ifndef PROCINFO_DECL = { + "power6x", "dfp", "pa6t", "arch_2_05", "ic_snoop", "smt", "booke", "cellbe", "power5+", "power5", "power4", "notb", "efpdouble", "efpsingle", "spe", @@ -66,11 +67,17 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[20][10] #if !defined PROCINFO_DECL && defined SHARED ._dl_powerpc_platforms #else -PROCINFO_CLASS const char _dl_powerpc_platforms[6][12] +PROCINFO_CLASS const char _dl_powerpc_platforms[7][12] #endif #ifndef PROCINFO_DECL = { - "power4", "ppc970", "power5", "power5+", "power6", "ppc-cell-be" + [PPC_PLATFORM_POWER4] = "power4", + [PPC_PLATFORM_PPC970] = "ppc970", + [PPC_PLATFORM_POWER5] = "power5", + [PPC_PLATFORM_POWER5_PLUS] = "power5+", + [PPC_PLATFORM_POWER6] = "power6", + [PPC_PLATFORM_CELL_BE] = "ppc-cell-be", + [PPC_PLATFORM_POWER6X] = "power6x" } #endif #if !defined SHARED || defined PROCINFO_DECL diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h index f63da6d555..0bf935385a 100644 --- a/sysdeps/powerpc/dl-procinfo.h +++ b/sysdeps/powerpc/dl-procinfo.h @@ -24,19 +24,29 @@ #include /* This defines the PPC_FEATURE_* macros. */ /* There are 20 bits used, but they are bits 12..31. */ -#define _DL_HWCAP_FIRST 12 +#define _DL_HWCAP_FIRST 9 #define _DL_HWCAP_COUNT 32 /* These bits influence library search. */ -#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC) +#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \ + + PPC_FEATURE_HAS_DFP) -#define _DL_PLATFORMS_COUNT 6 +#define _DL_PLATFORMS_COUNT 7 #define _DL_FIRST_PLATFORM 32 /* Mask to filter out platforms. */ #define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \ << _DL_FIRST_PLATFORM) +/* Platform bits (relative to _DL_FIRST_PLATFORM). */ +#define PPC_PLATFORM_POWER4 0 +#define PPC_PLATFORM_PPC970 1 +#define PPC_PLATFORM_POWER5 2 +#define PPC_PLATFORM_POWER5_PLUS 3 +#define PPC_PLATFORM_POWER6 4 +#define PPC_PLATFORM_CELL_BE 5 +#define PPC_PLATFORM_POWER6X 6 + static inline const char * __attribute__ ((unused)) _dl_hwcap_string (int idx) @@ -68,22 +78,30 @@ _dl_string_platform (const char *str) if (str == NULL) return -1; - if (strncmp (str, GLRO(dl_powerpc_platforms)[0], 5) == 0) + if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0) { int ret; str += 5; switch (*str) { case '4': - ret = _DL_FIRST_PLATFORM + 0; + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4; break; case '5': - ret = _DL_FIRST_PLATFORM + 2; + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5; if (str[1] == '+') - ++ret, ++str; + { + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS; + ++str; + } break; case '6': - ret = _DL_FIRST_PLATFORM + 4; + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6; + if (str[1] == 'x') + { + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X; + ++str; + } break; default: return -1; @@ -91,12 +109,16 @@ _dl_string_platform (const char *str) if (str[1] == '\0') return ret; } - else if (strncmp (str, GLRO(dl_powerpc_platforms)[1], 3) == 0) + else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970], + 3) == 0) { - if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[1] + 3) == 0) - return _DL_FIRST_PLATFORM + 1; - else if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[5] + 3) == 0) - return _DL_FIRST_PLATFORM + 5; + if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970] + + 3) == 0) + return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970; + else if (strcmp (str + 3, + GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3) + == 0) + return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE; } return -1; diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h index a376e4dac3..2ae52b78c0 100644 --- a/sysdeps/powerpc/sysdep.h +++ b/sysdeps/powerpc/sysdep.h @@ -34,13 +34,16 @@ #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */ #define PPC_FEATURE_NO_TB 0x00100000 /* 601/403gx have no timebase */ #define PPC_FEATURE_POWER4 0x00080000 /* POWER4 ISA 2.00 */ -#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.01 */ -#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.02 */ +#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.02 */ +#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.03 */ #define PPC_FEATURE_CELL_BE 0x00010000 /* CELL Broadband Engine */ #define PPC_FEATURE_BOOKE 0x00008000 -#define PPC_FEATURE_SMT 0x00004000 +#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous Multi-Threading */ #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 #define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */ +#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_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC) #ifdef __ASSEMBLER__ diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S index 208a375ef3..9451f9eb36 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S @@ -26,9 +26,7 @@ ENTRY(__makecontext) /* Set up the first 7 args to the function in its registers */ - addi r11,r3,_UC_REG_SPACE+12 - clrrwi r11,r11,4 - stw r11,_UC_REGS_PTR(r3) + lwz r11,_UC_REGS_PTR(r3) stw r6,_UC_GREGS+(PT_R3*4)(r11) stw r7,_UC_GREGS+(PT_R4*4)(r11) stw r8,_UC_GREGS+(PT_R5*4)(r11) -- cgit v1.2.3