Problem - ChibiOS under Code Warrior

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
ksweeney
Posts: 6
Joined: Sat Jun 01, 2013 3:41 pm

Problem - ChibiOS under Code Warrior

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Problem - ChibiOS under Code Warrior

Post 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
Post Reply