Skip to contentSkip to conversation

sal calls w/o taking sal_lock

PATCH David Mosberger 5 participants 6 messages Apr 1, 2003 – Apr 2, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes

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/[email protected]?nav=index.html

	--david
#1 lore raw
Quoted 8 lines · David Mosberger

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/[email protected]?nav=index.html

Oops! That's what I get for not checking bkbits before I post something... Anyway, glad it's there.

Thanks,
Jesse

#2 lore raw
In reply to David Mosberger
Quoted 10 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes

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/[email protected]?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.

#3 lore raw
In reply to David Mosberger
Quoted 3 lines

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

#4 lore raw
In reply to David Mosberger
Quoted 10 lines · Kevin
Quoted 3 lines

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:

Quoted 7 lines
	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.

#5 lore raw
In reply to David Mosberger

Keith Owens <[email protected]> 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.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
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."