Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Joel Soete <soete.joel@tiscali.be>
To: Kyle McMartin <kyle@mcmartin.ca>
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] memory barriers, spinlocks, debuglocks, oh my
Date: Sun, 29 Aug 2004 16:11:10 +0000	[thread overview]
Message-ID: <4132001E.6060707@tiscali.be> (raw)
In-Reply-To: <20040828221524.GT2414@mcmartin.ca>



Kyle McMartin wrote:
> Once more unto the brink,
> 
> Commitable?
> 
mmm,

[...]

> Index: include/asm-parisc/atomic.h
> ===================================================================
> RCS file: /var/cvs/linux-2.4/include/asm-parisc/atomic.h,v
> retrieving revision 1.10
> diff -u -r1.10 atomic.h
> --- include/asm-parisc/atomic.h	13 Sep 2002 21:43:37 -0000	1.10
> +++ include/asm-parisc/atomic.h	28 Aug 2004 18:56:09 -0000
> @@ -30,8 +30,11 @@
>   *
>   * XXX REVISIT these could be renamed and moved to spinlock_t.h as well
>   */
> -#define SPIN_LOCK(x)	do { while(__ldcw(&(x)->lock) == 0); } while(0)
> -#define SPIN_UNLOCK(x)  do { (x)->lock = 1; } while(0)
> +#define SPIN_LOCK(x) do { while(__ldcw(&(x)->lock) == 0); } while(0)
> +#define SPIN_UNLOCK(x) do {  \
> +                         __asm__ __volatile__ ("stw,ma %1,0(%0)" \
> +                         : : "r" (&(x)->lock), "r" (0) : "memory"); \
> +                       } while (0)
>  
Sorry, but here I am confused: for parisc-linux unlock means (x)->lock = 1?

may be the jda idea: <http://lists.parisc-linux.org/pipermail/parisc-linux/2004-August/024440.html>
#define __lock_reset(lock_addr,tmp) \
   __asm__ __volatile__ ("stw,ma %1,0(%0)" \
			 : : "r" (lock_addr), "r" (tmp) : "memory");
(tmp or flag may be?)

and if I better understand the idea:

#define SPIN_UNLOCK(x)	__lock_reset((&(x)->lock), 1)

What do you think?

Joel
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  reply	other threads:[~2004-08-29 16:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 16:37 [parisc-linux] memory barriers, spinlocks, debuglocks, oh my Kyle McMartin
     [not found] ` <1093625820.2010.26.camel@mulgrave>
     [not found]   ` <20040827170342.GD25975@baldric.uwo.ca>
2004-08-28 16:57     ` Joel Soete
2004-08-28 17:07       ` Kyle McMartin
2004-08-28 22:15 ` Kyle McMartin
2004-08-29 16:11   ` Joel Soete [this message]
2004-08-29 16:13     ` Kyle McMartin
2004-08-30  4:06       ` Grant Grundler
2004-08-30  4:14         ` Kyle McMartin
2004-08-30  4:30           ` Grant Grundler
2004-08-30  4:37             ` Kyle McMartin
2004-08-29 16:14     ` Thibaut VARENE
2004-08-29 17:45     ` John David Anglin

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=4132001E.6060707@tiscali.be \
    --to=soete.joel@tiscali.be \
    --cc=kyle@mcmartin.ca \
    --cc=parisc-linux@lists.parisc-linux.org \
    /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