From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13745 invoked by alias); 21 Oct 2004 07:02:42 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 13725 invoked from network); 21 Oct 2004 07:02:41 -0000 Received: from unknown (HELO r-rr.iij4u.or.jp) (210.130.0.76) by sourceware.org with SMTP; 21 Oct 2004 07:02:41 -0000 Received: from localhost (frgw.3in.ne.jp [210.251.121.226]) by r-rr.iij4u.or.jp (8.11.6+IIJ/8.11.6) with ESMTP id i9L72cn17715 for ; Thu, 21 Oct 2004 16:02:39 +0900 (JST) Date: Thu, 21 Oct 2004 07:02:00 -0000 Message-Id: <20041021.160207.35808965.kkojima@rr.iij4u.or.jp> To: libc-hacker@sources.redhat.com Subject: [PATCH] SH: A tiny NPTL update From: Kaz Kojima Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00027.txt.bz2 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 * 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: