Commit Graph

768 Commits

Author SHA1 Message Date
Joseph Myers f4cf5f2d8b Add script to update copyright notices and reformat some to facilitate its use. 2013-01-01 16:29:10 +00:00
David S. Miller 9c7595bda2 Add sparc implementation of lll_futex_timed_wait_bitset
nptl/

	* sysdeps/unix/sysv/linux/sparc/lowlevellock.h
	(lll_futex_timed_wait_bitset): New macro.
2012-12-27 08:20:46 -08:00
Siddhesh Poyarekar 8ebac7785b [s390] Replace lll_futex_* assembly code with INTERNAL_SYSCALL 2012-12-27 20:43:02 +05:30
Siddhesh Poyarekar 56e7d3ad5c Fix some build warnings on s390x 2012-12-08 13:03:24 +05:30
Joseph Myers d39b954531 Remove unused variable from powerpc sem_post.c. 2012-12-04 21:39:04 +00:00
Joseph Myers 09e958ed42 Remove unused variable from sem_post.c. 2012-11-21 20:00:52 +00:00
Siddhesh Poyarekar 8f861542dd [S390,PPC] Implement FUTEX_WAIT_BITSET for timedwait functions
Since the FUTEX_WAIT operation takes a relative timeout, the
pthread_cond_timedwait and other timed function implementations have
to get a relative timeout from the absolute timeout parameter it gets
before it makes the futex syscall.  This value is then converted back
into an absolute timeout within the kernel.  This is a waste and has
hence been improved upon by a FUTEX_WAIT_BITSET operation (OR'd with
FUTEX_CLOCK_REALTIME to make the kernel use the realtime clock instead
of the default monotonic clock).  This was implemented only in the x86
and sh assembly code and not in the C code.  This patch implements
support for FUTEX_WAIT_BITSET whenever available (since linux-2.6.29)
for s390 and powerpc.
2012-11-05 21:12:52 +05:30
David S. Miller d3bd58cf0a Fix coding style in sparc lowlevellock.h
nptl/

	* sysdeps/unix/sysv/linux/sparc/lowlevellock.h (BUSY_WAIT_NOP):
	Add missing spaces.
	(__cpu_relax): Likewise.
2012-11-03 15:25:55 -07:00
David S. Miller 19f1dd5f2d Define a BUSY_WAIT_NOP for sparc.
nptl/

	* sysdeps/unix/sysv/linux/sparc/lowlevellock.h (BUSY_WAIT_NOP):
	Define when we have v9 instructions available.
	* sysdeps/unix/sysv/linux/sparc/sparc64/cpu_relax.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/cpu_relax.S: New
	file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/Makefile: New
	file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Add cpu_relax
	to libpthread-routines.
2012-10-28 23:19:00 -07:00
Siddhesh Poyarekar 9485a40444 Adjust mutex lock in condvar_cleanup if we got it from requeue_pi
This completes the fix to bz #14652.
2012-10-16 14:23:35 +05:30
Siddhesh Poyarekar 0e3b5d6a68 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.
2012-10-10 12:52:56 +05:30
Siddhesh Poyarekar c30e8edf7c 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.
2012-10-05 18:52:36 +05:30
Siddhesh Poyarekar adcdc775e1 Fix clone flag name in comment to CLONE_CHILD_CLEARTID. 2012-10-02 08:52:55 +05:30
Siddhesh Poyarekar 55a051c985 Fix exception table for i386 pthread_cond_wait
[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.
2012-10-01 23:21:39 +05:30
Alan Modra 7e2fca8dd2 Fix bugs in powerpc pthread_once.
Ref gcc.gnu.org/bugzilla/show_bug.cgi?id=52839#c10

Release barriers are needed to ensure that any memory written by
init_routine is seen by other threads before *once_control changes.
In the case of clear_once_control we need to flush any partially
written state.
2012-09-25 16:30:06 -05:00
Joseph Myers 26889eacc2 Remove __ASSUME_POSIX_CPU_TIMERS. 2012-09-01 21:32:04 +00:00
Joseph Myers 033d54a2d4 Fix sem_post race (bug 14532). 2012-08-31 19:49:31 +00:00
Roland McGrath b2e1c56272 Make libio compile without _IO_MTSAFE_IO. 2012-08-17 09:35:36 -07:00
Joseph Myers 93a78ac437 Remove __ASSUME_POSIX_TIMERS. 2012-08-16 14:03:43 +00:00
Joseph Myers b36137f1d6 Remove __ASSUME_TGKILL. 2012-08-08 23:22:53 +00:00
Andreas Schwab 842a39cd1a Remove unused pseudo_end label 2012-07-25 21:58:17 +02:00
Thomas Schwinge 4b2c8da708 SH: __lll_robust_timedlock_wait: Simplify CFI directives. 2012-06-23 12:17:44 +02:00
H.J. Lu 0e20515a17 Use x86-64 bits/pthreadtypes.h/semaphore.h for i386/x86-64 2012-05-30 17:29:22 -07:00
Andreas Schwab 4d17e68350 Remove use of INTDEF/INTUSE in nptl 2012-05-30 00:45:53 +02:00
Chung-Lin Tang d701a1abe2 SH: Add CFI directives. 2012-05-28 00:47:07 +02:00
Chung-Lin Tang 65a4de4e06 SH: Add CFI directives. 2012-05-28 00:11:06 +02:00
Rayson Ho 1755728208 i386 port of the pthread SystemTap probes 2012-05-25 13:41:04 -07:00
Roland McGrath 5acf7263d5 Add systemtap static probe points in generic and x86_64 pthread code. 2012-05-25 13:41:03 -07:00
Andreas Jaeger de7f5ce7c5 Fix warnings on Linux/i686
Fixes:
../sysdeps/i386/dl-machine.h:336:30: warning: unused variable ‘refsym’ [-Wunused-variable]
rtld.c:1435:3: warning: implicit declaration of function ‘_dl_discover_osversion’ [-Wimplicit-function-declaration]
2012-05-17 20:17:53 +02:00
H.J. Lu f16af74217 Use R*_LP to load pointer and operate on stack 2012-05-15 14:25:31 -07:00
H.J. Lu d9754f5572 Use LP_OP(cmp) and RCX_LP on dep_mutex pointer 2012-05-15 13:39:25 -07:00
H.J. Lu dde05f0093 Use LP_OP(op), LP_SIZE and ASM_ADDR in sem_wait.S 2012-05-15 12:48:26 -07:00
H.J. Lu 9dba3b5c0a se LP_OP(op), LP_SIZE and ASM_ADDR in sem_timedwait.S 2012-05-15 12:47:31 -07:00
H.J. Lu 5f658cf147 Use LP_OP(cmp) on NWAITERS 2012-05-15 10:25:51 -07:00
H.J. Lu 6cae4b26ca Use LP_SIZE and ASM_ADDR in pthread_once.S 2012-05-15 10:24:19 -07:00
H.J. Lu 592f90e6ec Use LP_OP(cmp), R*_LP, LP_SIZE and ASM_ADDR 2012-05-15 10:23:22 -07:00
H.J. Lu 0e8860ad21 Use LP_OP(cmp), R*_LP, LP_SIZE and ASM_ADDR 2012-05-15 10:21:32 -07:00
H.J. Lu 30996e9369 Use LP_OP(cmp) and RCX_LP on dep_mutex pointer 2012-05-15 10:20:15 -07:00
H.J. Lu 289ac4352a Use LP_OP(mov) and RDI_LP on pointer 2012-05-15 10:19:11 -07:00
H.J. Lu 10f74fbcde Use LP_SIZE and load timeout pointer into RDX_LP 2012-05-15 10:03:56 -07:00
Siddhesh Poyarekar 439bf404b8 Allow a single-threaded program to cancel itself
There is nothing in the POSIX specification to disallow a
single-threaded program from cancelling itself, so we forcibly enable
multiple_threads to allow the next available cancellation point in the
thread to run.

Also added additional tests to cover various cancellation scenarios.
2012-05-15 09:41:57 +05:30
H.J. Lu b8caea2cb9 Add x32 pthread types 2012-05-14 12:56:56 -07:00
H.J. Lu c0d2c8538a Check __x86_64__ for __cleanup_fct_attribute 2012-05-11 10:12:42 -07:00
Chung-Lin Tang e1b4354e66 Use CFI statements instead of hand-coding .eh_frame. 2012-05-09 17:48:42 +08:00
H.J. Lu 4adaaafc9e Use __NR_futex to define SYS_futex 2012-03-19 14:54:35 -07:00
David S. Miller 7e7fa5f871 Fix libc-lowlevellock.c sysdep finding more generically.
nptl/

	[BZ #13844]
	* sysdeps/unix/sysv/linux/libc-lowlevellock.c: Include using <..>
	instead of "...".
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc-lowlevellock.c:
	Delete, not needed.
2012-03-16 20:40:54 -07:00
David S. Miller c4a7b16eb8 Add missing sparc32 NPTL file otherwise we use the wrong lowlevellock.c implementation.
nptl/

	[BZ #13844]
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc-lowlevellock.c: New file.
2012-03-15 21:13:02 -07:00
David S. Miller c64bf5feb3 Update copyright year after my most recent changes.
nptl/

	* sysdeps/unix/sysv/linux/sparc/sem_post.c: Update copyright year.

/

	* sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: Update
	copyright year.
	* sysdeps/unix/sysv/linux/sparc/sysdep.h: Likewise.
2012-03-08 15:09:27 -08:00
Thomas Schwinge 2edd9a79e5 Work around kernel rejecting valid absolute timestamps. 2012-03-08 11:22:41 +01:00
Thomas Schwinge c564a81246 Invalid timeouts in SH sem_timedwait.
We adjusted nwaiters even though this isn't necessary.
2012-03-08 10:45:05 +01:00