* [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock
2003-04-01 20:28 [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock David Mosberger
@ 2003-04-01 20:32 ` Jesse Barnes
2003-04-02 5:18 ` Keith Owens
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jesse Barnes @ 2003-04-01 20:32 UTC (permalink / raw)
To: linux-ia64
On Tue, Apr 01, 2003 at 12:28:26PM -0800, David Mosberger wrote:
> Jesse> This patch adds SAL_CALL_NOLOCK so that platforms may call the SAL
> Jesse> without taking a lock, if appropriate. The ia64_sal_mc_rendez() has
> Jesse> been changed to use it, since it won't return until all CPUs have been
> Jesse> rendevoused by the SAL, if I understand correctly. It's also used by
> Jesse> various SN specific SAL routines that access the system controllers
> Jesse> and might be useful to other plaforms.
>
> http://lia64.bkbits.net:8080/to-linus-2.5/cset@1.1113?nav=index.html
Oops! That's what I get for not checking bkbits before I post
something... Anyway, glad it's there.
Thanks,
Jesse
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock
2003-04-01 20:28 [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock David Mosberger
2003-04-01 20:32 ` Jesse Barnes
@ 2003-04-02 5:18 ` Keith Owens
2003-04-02 6:09 ` Van Maren, Kevin
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Keith Owens @ 2003-04-02 5:18 UTC (permalink / raw)
To: linux-ia64
On Tue, 1 Apr 2003 12:28:26 -0800,
David Mosberger <davidm@napali.hpl.hp.com> wrote:
>>>>>> On Tue, 1 Apr 2003 10:06:44 -0800, Jesse Barnes <jbarnes@sgi.com> said:
>
> Jesse> This patch adds SAL_CALL_NOLOCK so that platforms may call the SAL
> Jesse> without taking a lock, if appropriate. The ia64_sal_mc_rendez() has
> Jesse> been changed to use it, since it won't return until all CPUs have been
> Jesse> rendevoused by the SAL, if I understand correctly. It's also used by
> Jesse> various SN specific SAL routines that access the system controllers
> Jesse> and might be useful to other plaforms.
>
>http://lia64.bkbits.net:8080/to-linus-2.5/cset@1.1113?nav=index.html
I do not understand why you renamed the variables. The SAL code is
enclosed in do { } while(); All variables within {} are local, they do
not need unique names.
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock
2003-04-01 20:28 [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock David Mosberger
2003-04-01 20:32 ` Jesse Barnes
2003-04-02 5:18 ` Keith Owens
@ 2003-04-02 6:09 ` Van Maren, Kevin
2003-04-02 6:20 ` Keith Owens
2003-04-02 8:55 ` Andreas Schwab
4 siblings, 0 replies; 6+ messages in thread
From: Van Maren, Kevin @ 2003-04-02 6:09 UTC (permalink / raw)
To: linux-ia64
> I do not understand why you renamed the variables. The SAL code is
> enclosed in do { } while(); All variables within {} are
> local, they do not need unique names.
What happens to this:
#define foo(arg) do { int flag; arg = flag; } while (0)
If I do this:
foo(flag);
Answer:
do { int flag; flag = flag; } while (0);
Does his change make more sense now?
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock
2003-04-01 20:28 [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock David Mosberger
` (2 preceding siblings ...)
2003-04-02 6:09 ` Van Maren, Kevin
@ 2003-04-02 6:20 ` Keith Owens
2003-04-02 8:55 ` Andreas Schwab
4 siblings, 0 replies; 6+ messages in thread
From: Keith Owens @ 2003-04-02 6:20 UTC (permalink / raw)
To: linux-ia64
On Wed, 2 Apr 2003 00:09:53 -0600 ,
"Van Maren, Kevin" <kevin.vanmaren@unisys.com> wrote:
>> I do not understand why you renamed the variables. The SAL code is
>> enclosed in do { } while(); All variables within {} are
>> local, they do not need unique names.
>
>What happens to this:
>
>#define foo(arg) do { int flag; arg = flag; } while (0)
>
>If I do this:
>
> foo(flag);
>
>Answer:
>
> do { int flag; flag = flag; } while (0);
>
>Does his change make more sense now?
You get around that by using __flags in the macro. You do not need
__ia64_sc_flags in SAL_CALL() and a different __ia64_scn_flags in
SAL_CALL_NOLOCK(). The old SAL_CALL() code has been there since IA64
was released and has never had any problems with name scopes.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock
2003-04-01 20:28 [Linux-ia64] Re: [PATCH] sal calls w/o taking sal_lock David Mosberger
` (3 preceding siblings ...)
2003-04-02 6:20 ` Keith Owens
@ 2003-04-02 8:55 ` Andreas Schwab
4 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2003-04-02 8:55 UTC (permalink / raw)
To: linux-ia64
Keith Owens <kaos@ocs.com.au> writes:
|> I do not understand why you renamed the variables. The SAL code is
|> enclosed in do { } while(); All variables within {} are local, they do
|> not need unique names.
Now consider what happens when you have a reference to a variable named
flags or fr in one of the macro arguments.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread