This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help Putting ARM Instruction Inline GCC

Note: This was originally posted on 15th December 2010 at http://forums.arm.com

I am trying to use the "Wait For Interrupt" ARM instruction by typing this in my .c source file:


int  main(void)
{
     __asm__ __volatile__ ( "MCR p15, 0, Rd, c7, c0, 4" );

}



but when I try to compile GCC I get this error:
/tmp/cc5VrFFc.s: Assembler messages:
/tmp/cc5VrFFc.s:153: Error: register expected, not 'Rd,c7,c0,4' -- `mcr p15,0,Rd,c7,c0,4'


and I turned off thumbs using this flag:  -mno-thumb

How do I call that instruction?

thanks


I know there is this doc: http://www.ethernut.de/en/documents/arm-inline-asm.html

which I tried using. Didn't help.


The wait for interrupt instruction is here: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0201d/I1035380.html
0