Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
SalAmmoniac
PostPosted: Mar 14, 2012 - 11:18 PM
Hangaround


Joined: Jun 15, 2009
Posts: 134
Location: Northern California

If I have an AVR32 UC3 function compiled with __attribute__ ((naked)), the compiler doesn't generate any prolog or epilog code, but it still seems to assume the frame pointer (r7) is pointing somewhere useful, as this code cut and pasted from the disassembly window shows:

Code:
{

    TCB   *tptr;

    SAVECONTEXT();
80000E2C  pushm R0-R3, R4-R7      
   clearsv();                       // clear GPIO interrupt
80000E2E  mcall 0x80000e64      
    tptr = scheduler();             // see if another task is ready to run
80000E32  mcall 0x80000e68      
80000E36  mov R8, R12      
80000E38  st.w R7[-4], R8      
    if(tptr) {
80000E3C  ld.w R8, R7[-4]      
80000E40  cp.w R8, 0      
80000E42  breq 0x80000e5e      


Notice the references to r7? Why is the compiler assuming that r7 points to the stack frame?

This is in Atmel Studio 6, BTW.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits