From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 16829 invoked from network); 24 Nov 1999 05:27:50 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 24 Nov 1999 05:27:50 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id AAA04426 for ; Wed, 24 Nov 1999 00:27:50 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.9.3/8.9.3) id VAA13285 for axp-list@redhat.com; Tue, 23 Nov 1999 21:27:49 -0800 Date: Tue, 23 Nov 1999 21:27:49 -0800 From: Richard Henderson To: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter Message-ID: <19991123212749.A13282@twiddle.net> References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> <19991107164713.A7248@twiddle.net> <3826D83F.7B73A97@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <3826D83F.7B73A97@zk3.dec.com>; from Peter Rival on Mon, Nov 08, 1999 at 09:03:46AM -0500 On Mon, Nov 08, 1999 at 09:03:46AM -0500, Peter Rival wrote: > I wonder myself sometimes...;) Basically I was trying to do something > like "try to grab the read lock once, and if you fail, bail out". I > was just trying to modify read_lock to do something like that. I > suppose it would have been better to write it more like this: > > static __inline__ int _read_try_lock_(void *lock) > { > long temp,result=0; > __asm__ __volatile__( > "1: ldl_l %1,%0\n" > " blbs %1,6f\n" > " subl %1,2,%1\n" > " stl_c %1,%0\n" > " beq %1,6f\n" > " mb\n" > ".section .text2,\"ax\"\n" > "6: mov %1,%2\n" > ".previous" > : "=m" (__dummy_lock(lock)), "=&r" (temp), "=&r" (result) > : "m" (__dummy_lock(lock)) You _do_ realize that you're _still_ missing the branch back to label 1b? > But that looks kinda ugly. I really don't want to unconditionally > copy lock into the result, as I've already set the result to zero. What you have still doesn't make sense to me. I don't know what you're after. r~