AVR prologue & epilogue

Jim Wilson wilson@tuliptree.org
Thu Jun 12 23:49:00 GMT 2003


Svein E. Seldal wrote:
> I'm working with some code targetted for the AVR platform. In an 
> interrupt service routine, I need to switch stack just _prior_ to the 
> push'es of this routine and then switch back the stack just after the 
> pop's of the function. (This switch code is written assembly.)

If you need to do something funny, it is probably better to write the 
code in assembly language instead of C.  You can have a stub that calls 
to a C function if that helps.  Then you only need the stack switching 
code in the assembly language code.

Otherwise, you probably need to add support for a machine dependent 
attribute or pragma, and it will be hard to justify this for inclusion 
in gcc unless you can generalize it in a useful way.

Jim





More information about the Gcc mailing list