public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] SH: A tiny NPTL update
@ 2004-07-14 13:02 Kaz Kojima
  2004-07-14 16:46 ` Ulrich Drepper
  0 siblings, 1 reply; 4+ messages in thread
From: Kaz Kojima @ 2004-07-14 13:02 UTC (permalink / raw)
  To: libc-hacker

Hi,

The patch below is similar with that for x86.

Regards,
	kaz
--
2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
	(__pthread_cond_timedwait): Check for invalid nanosecond in
	timeout value.

diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S	Tue Jun 29 16:26:54 2004
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S	Wed Jul 14 14:47:16 2004
@@ -62,6 +62,12 @@ __pthread_cond_timedwait:
 	add	r0, r12
 #endif
 
+	mov.l	@(4,r13), r0
+	mov.l	.L1g, r1
+	cmp/hs	r1, r0
+	bt/s	18f
+	 mov	#EINVAL, r0
+
 	/* Get internal lock.  */
 	mov	#0, r3
 	mov	#1, r4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] SH: A tiny NPTL update
  2004-07-14 13:02 [PATCH] SH: A tiny NPTL update Kaz Kojima
@ 2004-07-14 16:46 ` Ulrich Drepper
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2004-07-14 16:46 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

I've put in the three patches.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] SH: A tiny NPTL update
  2004-10-21  7:02 Kaz Kojima
@ 2004-10-21  9:00 ` Ulrich Drepper
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2004-10-21  9:00 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBd3qV2ijCOnn/RHQRAnsfAKCSdn05nxZ7s6gcC9TqhWLMvPi4xwCdFvio
8bP6+6PVKoJAY5xZLvdNoZg=
=sv4e
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] SH: A tiny NPTL update
@ 2004-10-21  7:02 Kaz Kojima
  2004-10-21  9:00 ` Ulrich Drepper
  0 siblings, 1 reply; 4+ messages in thread
From: Kaz Kojima @ 2004-10-21  7:02 UTC (permalink / raw)
  To: libc-hacker

Hi,

The patch below is a similar change with that for x86 and also
fixes a few silly mistakes.

Regards,
	kaz
--
2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/unix/sysv/linux/sh/lowlevellock.S
	(__lll_mutex_timedlock_wait): If woken but cannot get the lock,
        make sure 2 is stored in the futex and we looked at the old value.
	Fix a few other problems to return the correct value.

diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	Sat Mar 20 15:24:28 2004
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	Thu Oct 21 12:51:15 2004
@@ -127,13 +127,14 @@ __lll_mutex_timedlock_wait:
 	extu.b	r3, r3
 	trapa	#0x14
 	SYSCALL_INST_PAD
-	mov	r0, r4
+	mov	r0, r5
 
-8:	
+8:
 	mov	#0, r3
 	mov	#2, r4
 	CMPXCHG (r3, @r8, r4, r2)
-	bf	7f
+	bf/s	7f
+	 mov	#0, r0
 
 6:
 	add	#8, r15
@@ -144,8 +145,14 @@ __lll_mutex_timedlock_wait:
 7:
 	/* Check whether the time expired.  */
 	mov	#-ETIMEDOUT, r1
-	cmp/eq	r4, r1
+	cmp/eq	r5, r1
 	bt	5f
+
+	/* Make sure the current holder knows we are going to sleep.  */
+	XCHG (r2, @r8, r3)
+	tst	r3, r3
+	bt/s	6b
+	 mov	#0, r0
 	bra	1b
 	 nop
 3:

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-21  9:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-14 13:02 [PATCH] SH: A tiny NPTL update Kaz Kojima
2004-07-14 16:46 ` Ulrich Drepper
2004-10-21  7:02 Kaz Kojima
2004-10-21  9:00 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).