Chris Metcalf [Thu, 11 Oct 2012 16:15:45 +0000 (12:15 -0400)]
tilegx: add optimized sched_getcpu() using TILE_COORD SPR
We can discover our x,y coordinate in the core mesh with an
mfspr instruction, multiply y by the core mesh width, and have
the core number without needing to ask the kernel.
Carlos O'Donell [Thu, 11 Oct 2012 03:28:52 +0000 (23:28 -0400)]
Fix formatting in nptl/sysdeps/pthread/pthread.h.
The macro pthread_cleanup_push_defer_np in pthread.h has a misaligned
line continuation marker. This marker was previously aligned, but
recent changes have moved it out of alignment. This change realigns
the marker. This also reduces the diff against the hppa version of
pthread.h where the marker is aligned.
Carlos O'Donell [Thu, 11 Oct 2012 03:00:00 +0000 (23:00 -0400)]
hppa: Update pthread.h
Updates the hppa-specific pthread.h from the generic version.
After this update the only difference between the generic
version and the hppa version is the footer protected by the
_PTHREAD_H_HPPA_ guard.
Alexandre Oliva [Wed, 10 Oct 2012 10:05:46 +0000 (07:05 -0300)]
* crypt/crypt-entry.c: Include fips-private.h.
(__crypt_r, __crypt): Disable MD5 and DES if FIPS is enabled.
* crypt/md5c-test.c (main): Tolerate disabled MD5.
* sysdeps/unix/sysv/linux/fips-private.h: New file.
* sysdeps/generic/fips-private.h: New file, dummy fallback.
Alexandre Oliva [Wed, 10 Oct 2012 10:05:10 +0000 (07:05 -0300)]
* crypt/crypt-private.h: Include stdbool.h.
(_ufc_setup_salt_r): Return bool.
* crypt/crypt-entry.c: Include errno.h.
(__crypt_r): Return NULL with EINVAL for bad salt.
* crypt/crypt_util.c (bad_for_salt): New.
(_ufc_setup_salt_r): Check that salt is long enough and within
the specified alphabet.
* crypt/badsalttest.c: New file.
* crypt/Makefile (tests): Add it.
($(objpfx)badsalttest): New.
Take lock in pthread_cond_wait cleanup handler only when needed
[BZ #14652]
When a thread waiting in pthread_cond_wait with a PI mutex is
cancelled after it has returned successfully from the futex syscall
but just before async cancellation is disabled, it enters its
cancellation handler with the mutex held and simply calling a
mutex_lock again will result in a deadlock. Hence, it is necessary to
see if the thread owns the lock and try to lock it only if it doesn't.
David S. Miller [Sun, 7 Oct 2012 01:36:40 +0000 (18:36 -0700)]
Fix Niagara-4 memcpy bug on 32-bit.
* sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: On 32-bit, clear
upper 32-bits of the length value in %o2 since we use branch-on-register
tests which consider the entire 64-bit register.
David S. Miller [Sat, 6 Oct 2012 04:22:41 +0000 (21:22 -0700)]
Correct libthreadb register access for 64-bit sparc.
[BZ #14568]
* sysdeps/sparc/tls.h (DB_THREAD_SELF_INCLUDE): Delete.
(DB_THREAD_SELF): Use constants for the register offsets. Correct
the case of a 64-bit debugger with a 32-bit inferior.
* sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: New file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara4.S: New
file.
* sysdeps/sparc/sparc64/multiarch/Makefile: Add to
sysdep_routines.
* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Likewise.
* sysdeps/sparc/sparc64/multiarch/memset.S: Use Niagara-4 memset
and bzero when HWCAP_SPARC_CRYPTO is present.
Unlock mutex before going back to waiting for PI mutexes
[BZ #14417]
A futex call with FUTEX_WAIT_REQUEUE_PI returns with the mutex locked
on success. If such a successful thread is pipped to the cond_lock by
another spuriously woken waiter, it could be sent back to wait on the
futex with the mutex lock held, thus causing a deadlock. So it is
necessary that the thread relinquishes the mutex before going back to
sleep.
Dmitry V. Levin [Thu, 23 Aug 2012 14:29:43 +0000 (14:29 +0000)]
nscd: fix compilation flags
Commit 61653dfb81b776bb72ce4304175b861d77c357a8 added support for
compilers predefining _FORTIFY_SOURCE by adding -U_FORTIFY_SOURCE to
CPPFLAGS for these compilers, but that change doesn't work quite well in
case of nscd: its Makefile sets _FORTIFY_SOURCE using CFLAGS instead of
CPPFLAGS and, thanks to compilation rules defined in Makerules, CPPFLAGS
are passed to compiler after CFLAGS, resulting to a build with
_FORTIFY_SOURCE turned off.
This change implements a more safe method of passing preprocessor and
compiler flags so that no nscd modules could be accidentally forgotten.
Jeff Law [Mon, 1 Oct 2012 21:32:39 +0000 (15:32 -0600)]
2012-10-01 Patsy Franklin <pfrankli@redhat.com>
Honza Horak <hhorak@redhat.com>
* nis/yp_xdr.c (xdr_domainname): Use YPMAXDOMAIN as maxsize.
(xdr_mapname): Use YPMAXMAP as maxsize.
(xdr_peername): Use YPMAXPEER as maxsize.
(xdr_keydat): Use YPAXRECORD as maxsize.
(xdr_valdat): Use YPMAXRECORD as maxsize.
[BZ #14477]
Add an additional entry in the exception table to jump to
__condvar_w_cleanup2 instead of __condvar_w_cleanup for PI mutexes
when %ebx contains the address of the futex instead of the condition
variable.
David S. Miller [Fri, 28 Sep 2012 20:02:42 +0000 (13:02 -0700)]
Add Niagara-4 optimized memcpy and mempcpy.
* sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: New file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-niagara4.S: New
file.
* sysdeps/sparc/sparc64/multiarch/Makefile: Add to
sysdep_routines.
* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Likewise.
* sysdeps/sparc/sparc64/multiarch/memcpy.S: Use Niagara-4 memcpy
and mempcpy when HWCAP_SPARC_CRYPTO is set.
* stdio-common/Makefile (tst-sprintf-ENV): Set environment
for testcase.
* stdio-common/tst-sprintf.c: Include <locale.h>
(main): Test sprintf's handling of incomplete multibyte
characters.