Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: axp-list@redhat.com
Subject: Re: Assembly errors with lockmeter
Date: Tue, 23 Nov 1999 21:27:49 -0800	[thread overview]
Message-ID: <19991123212749.A13282@twiddle.net> (raw)
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~


      reply	other threads:[~1999-11-24  5:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-02 19:24 Assembly errors with lockmeter Peter Rival
1999-11-02 20:19 ` Richard Henderson
1999-11-02 20:41   ` Peter Rival
1999-11-02 20:57     ` Richard Henderson
1999-11-02 21:49       ` Cross Platform IDE Jonas Gustavsson
1999-11-03 21:32         ` Adam C Powell IV
1999-11-04  0:00           ` SV: " Jonas Gustavsson
1999-11-08  0:47     ` Assembly errors with lockmeter Richard Henderson
1999-11-08 14:03       ` Peter Rival
1999-11-24  5:27         ` Richard Henderson [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox