[coreboot] [PATCH] v3: make inline asm declarations consistent

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Dec 4 01:55:35 CET 2008

On 06.09.2008 23:22, Carl-Daniel Hailfinger wrote:
> On 06.09.2008 22:34, Stefan Reinauer wrote:
>> Carl-Daniel Hailfinger wrote:
>>> v3 uses all combinations of __asm__, asm, __volatile__, volatile and
>>> single variations to declare inline asm statements. "asm" is a GNU C
>>> extension, while volatile is ANSI C. That means:
>>> - __volatile__ can be replaced by volatile unless you use a pure K&R
>>> compiler.
>>> - asm is not a reserved keyword and should be replaced by __asm__.
>>> As a bonus, grepping for __asm__ returns less hits than asm because asm
>>> is also used as a normal word in comments.
>> What are the implications of this? I think we should either go __asm__
>> __volatile__ or asm volatile for the sake of looking at the code without
>> eye cancer, but not mix it.
>> We're absolutely gcc specific, so discussing about asm not being
>> reserved sounds a bit vain. Also, is __asm__ reserved? Reserved by whom?
>> I know more compilers that know about asm than __asm__ if we're really
>> trying to become non-GNU-centric.
>> What's the goal of your patch?
> Two goals:
> 1. __volatile__ is pointless since 1983 (ANSI-C). No idea why anyone
> uses it.
> 2. Neither __asm__ nor asm are reserved. Grepping for asm turns up lots
> of stuff that is not inline asm, so using __asm__ eases grepping.
> If you prefer asm volatile, tell me. I'll prepare an updated patch.

Stefan, do you prefer "asm volatile" or "__asm__ __volatile__"? From
your mail, it seems you prefer "asm volatile", but I want to make sure I
get it right.
This patch has been pending for quite a while and it would be great if I
could get rid of it.



More information about the coreboot mailing list