public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Kaz Kojima <kkojima@rr.iij4u.or.jp>
To: libc-hacker@sources.redhat.com
Subject: [PATCH] SH nptl tidyup
Date: Tue, 04 Dec 2007 04:14:00 -0000	[thread overview]
Message-ID: <20071204.131353.104040769.kkojima@rr.iij4u.or.jp> (raw)

Hi,

Here is a nptl patch for SH to sync with the recent x86 changes.

Regards,
        kaz
-
2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

        * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
        Store 2 before returning ETIMEDOUT.

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	2007-11-06 10:32:41.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	2007-12-04 13:02:45.000000000 +0900
@@ -225,6 +225,12 @@ __lll_timedlock_wait:
 	add	#-8, r15
 	cfi_adjust_cfa_offset(8)
 
+	mov	#2, r2
+	XCHG (r2, @r8, r3)
+
+	tst	r3, r3
+	bt	6f
+	
 1:
 	/* Get current time.  */
 	mov	r15, r4
@@ -250,17 +256,11 @@ __lll_timedlock_wait:
 	add	#-1, r2
 4:
 	cmp/pz	r2
-	bf	5f		/* Time is already up.  */
+	bf	2f		/* Time is already up.  */
 
 	mov.l	r2, @r15	/* Store relative timeout.  */
 	mov.l	r3, @(4,r15)
 
-	mov	#1, r3
-	mov	#2, r4
-	CMPXCHG (r3, @r8, r4, r2)
-	tst	r2, r2
-	bt	8f
-
 	mov	r8, r4
 	mov	r11, r5
 	LOAD_FUTEX_WAIT (r5, r0, r1)
@@ -272,39 +272,29 @@ __lll_timedlock_wait:
 	SYSCALL_INST_PAD
 	mov	r0, r5
 
-8:
-	mov	#0, r3
-	mov	#2, r4
-	CMPXCHG (r3, @r8, r4, r2)
-	bf/s	7f
-	 mov	#0, r0
+	mov	#2, r2
+	XCHG (r2, @r8, r3)
+
+	tst	r3, r3
+	bt/s	6f
+	 mov	#-ETIMEDOUT, r1
+	cmp/eq	r5, r1
+	bf	1b
+
+2:	mov	#ETIMEDOUT, r3
 
 6:
+	mov	r3, r0
 	add	#8, r15
 	mov.l	@r15+, r8
 	mov.l	@r15+, r9
 	mov.l	@r15+, r10
 	rts
 	 mov.l	@r15+, r11
-7:
-	/* Check whether the time expired.  */
-	mov	#-ETIMEDOUT, 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:
 	rts
 	 mov	#EINVAL, r0
-5:
-	bra	6b
-	 mov	#ETIMEDOUT, r0
 	cfi_endproc
 
 .L1k:


             reply	other threads:[~2007-12-04  4:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04  4:14 Kaz Kojima [this message]
2008-01-21 23:46 Kaz Kojima
2008-01-22 18:31 ` Ulrich Drepper
2008-12-04  4:01 Kaz Kojima
2008-12-05 22:06 ` Ulrich Drepper
2008-12-05 23:49   ` Kaz Kojima
2009-01-14  3:49 Kaz Kojima
2009-01-28 16:10 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071204.131353.104040769.kkojima@rr.iij4u.or.jp \
    --to=kkojima@rr.iij4u.or.jp \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).