This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Supervisor Calls on ARM Cortex-M3
- From: Maxim Kuvyrkov <maxim dot kuvyrkov at gmail dot com>
- To: Alex Alexandrov <alexalexsoft2009 at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 12 Jan 2013 16:17:25 +1300
- Subject: Re: Supervisor Calls on ARM Cortex-M3
- References: <50EF451F.6050901@GMail.com>
On 11/01/2013, at 11:47 AM, Alex Alexandrov wrote:
> Hello,
>
> Do the GCC C/C++ compilers support supervisor function calls on ARM Cortex M3/4 targets?
> I mean something like the IAR's "#pragma _swi" or the "__svc" keyword used by the RealView compiler.
> How can I make the compiler use the "svc" machine instruction when calling the function, instead of the regular "branch and link" instruction?
Inline assembly and google are your friends:
- http://stackoverflow.com/questions/13338314/gcc-arm-ensuring-args-are-retained-when-inlining-functions-with-inline-asm-st
- http://stackoverflow.com/questions/11377453/using-gcc-inline-assembly-with-instructions-that-take-immediate-values
--
Maxim Kuvyrkov