[RFC PATCH 0/2] ARM: assembler: Add uniform assembler framework

Nicolas Pitre nicolas.pitre at linaro.org
Fri Mar 2 16:40:55 EST 2012


On Thu, 1 Mar 2012, Dave Martin wrote:

> I have a workaround for the above now, but it's not pretty -- I seem to
> have opened a can of worms here.
> 
> 
> We would need something like
> 
> #define EXTENDED_ASM(stuff) asm ( ".include \"macros.inc\"\n\t" stuff )
> #define EXTENDED_VASM(stuff) asm volatile ( ".include \"macros.inc\"\n\t" stuff )
> 
> ...where macros.inc includes some logic to protect against multiple
> inclusion.
> 
> This would avoid problems caused by reordering done by the compiler.
> 
> I think this can work, but it may be a step too far...
> 
> 
> The above could help fix the incorrect way that asm/unified.h defines
> the it* macros (though admittedly that does not seem to have caused
> problems for anyone so far...)

"If it aint broken dont fix it."

Yes, we might be making assumptions that are not guaranteed by the tools 
here, but as long as you make sure that some assumption going wrong 
won't go unnoticed and produce a broken binary then it is probably fine.

I did like your initial approach better, even if there is a risk that 
future tools might break it.  At least there was very little chances for 
the build to succeed if the global asm macros are not defined early 
enough.


Nicolas



More information about the linux-arm-kernel mailing list