[okl4-developer] Problem with inline assembler on arm926ejs
Gabi Voiculescu
b304_a at yahoo.com
Thu Apr 10 11:40:23 EST 2008
Personally I would use another way to write this (use zero as an output register instead of passing it as clobber stuff to the GCC, notice how many ':' I use)
static inline void sleep(void)
{
#if defined(__GNUC__)
word_t zero = 0;
__asm__ __volatile__ (
" mcr p15, 0, %0 , c7, c0, 4 \n" /* Wait for interrupt */
: "=r" (zero) );
#endif
}
Incidentally, I think you got that error because you used "_(zero)" instead of "(zero)".
I recommend for you to also look at the following source to explain the how to on GCC inline assembly for ARM:
http://www.ethernut.de/en/documents/arm-inline-asm.html
Gabi Voiculescu
Lukas HANEL <lukas.hanel at st.com> wrote: Hi
I am trying to port OKL4 to a platform based on the arm926ejs core.
Therefore I copied the xscale platform folder and changed the
tools/machines.py to be based on an other processor architecture.
E.g.
< class pxa(xscale):
> class pxa(arm926ejs):
Trying to compile this gave me an error related to cryptic inline
assembler code.
However it seems, that the same code is working in other files, so I am
confused.
The problem occures in arm926ejs/cpu.h, but nearly the same code is used
in arm926ejs/cache.h
A similar syntax can be found in cache.h of other architectures.
Do you have a good reference for the inline assembly language?
Thanks
Lukas
Listing:
~/okl4_release_1.5.2nhk$ ./tools/build.py machine=nhk15 project=iguana
example=naming simulate --debug=presub
scons: Reading SConscript files ...
Warn: No serial driver configured, not building serial server
SERIAL_DRIVER is uart_8250
scons: done reading SConscript files.
scons: Building targets ...
[CXX ] build/pistachio/l4kernel/object/src/cache.o
In file included from platform/pxa/pistachio/include/plat/timer.h:92,
from arch/arm/pistachio/include/arch/config.h:377,
from pistachio/include/config.h:146,
from pistachio/include/l4.h:70,
from pistachio/src/cache.cc:65:
arch/arm/pistachio/cpu/arm926ejs/include/cpu/cpu.h: In static member
function `static void arm_cpu::sleep()':
arch/arm/pistachio/cpu/arm926ejs/include/cpu/cpu.h:99: error: expected
`)' before "_"
arch/arm/pistachio/cpu/arm926ejs/include/cpu/cpu.h:97: warning: unused
variable 'zero'
scons: *** [build/pistachio/l4kernel/object/src/cache.o] Error 1
scons: building terminated because of errors.
arch/arm/pistachio/cpu/arm926ejs/include/cpu/cpu.h:
static inline void sleep(void)
{
word_t zero = 0;
__asm__ __volatile__ (
" mcr p15, 0, "_(zero)", c7, c0, 4 ;" /* Wait for
interrupt */
#if defined(__GNUC__)
:: [zero] "r" (zero)
#endif
);
}
_______________________________________________
Developer mailing list
Developer at okl4.org
https://lists.okl4.org/mailman/listinfo/developer
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080409/17a7205a/attachment.htm
More information about the Developer
mailing list