Page 1 of 1

Problem - ChibiOS under Code Warrior

Posted: Fri Jul 12, 2013 6:17 pm
by ksweeney
I have been trying to get ChibiOS running in my existing project and have run into what my be a major snag.

It seems that Code Warrior does not support the ((naked)) attribute. Well, at least the Freescale PPC compiler doesn't. I believe Code Warrior does support it for some ARM architectures.

This is non-trivial. The ((naked)) attribute tells the compiler to not create prologue/epilogue code for the function. The extra code required must then be supplied by the application, which ChibiOS does.


Code: Select all

#if !defined(__DOXYGEN__)
__attribute__((naked))
#endif
void port_dummy1(void) {

  asm (".global _port_switch");

..more code......


Does anyone have a workaround or solution for this?

Re: Problem - ChibiOS under Code Warrior

Posted: Fri Jul 12, 2013 6:21 pm
by Giovanni
You may put that code in an asm module, some other ports do that and conventionally name the file coreasm.s.

The "naked" is a trick to make GCC not generate unreachable code, except for this it is non-functional.

Giovanni