avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] stack layout


From: Russell Shaw
Subject: Re: [avr-gcc-list] stack layout
Date: Thu, 30 Jun 2005 10:43:13 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1

Marek Michalkiewicz wrote:
On Mon, Jun 27, 2005 at 11:03:36AM +0200, Haase Bjoern (PT-BEU/EMT) * wrote:

I am presently re-implementing prologue/epilogue by RTL instead of text. I 
thought about posting it this week-end but weather was too fine and It will 
probably still take a couple of days in order to make sure, that also the 
TINY_STACK and NO_INTERRUPT cases are not broken. When doing this, I could 
implement the change of the status of the main function right away.?

I think it may be best to do it all in this order:

1. Change gcrt1.S in avr-libc to call main() instead of jumping to it;
   after main() returns, call exit().  I believe this should still be
   backwards-compatible with stable versions of GCC (where main() never
   returns, but jumps directly to exit() instead).
2. Implement the "OS_Task" function attribute (see the h8300 target;
   in IAR C it's called "__C_task" and you can see it in code examples
   found in some Atmel's app notes).  Applications should specify this
   for main(), to avoid unnecessary saving of call-saved registers.
3. Remove special handling of main().  This should simplify the function
   prologue/epilogue logic, making the next step easier.  After that,
   GCC will require the updated avr-libc (with change from step 1).
4. Finally, implement prologue/epilogue as RTL instead of text.

There is also an issue with avr-gdb, which scans function prologues
and handles main() specially.  But I can't help much here...

Marek

It's on my to-do list to understand the avr part of gdb that does
the prolog scanning and to improve it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]