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

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

[avr-gcc-list] WinAvr 20081205 and Xmega AVR


From: larry barello
Subject: [avr-gcc-list] WinAvr 20081205 and Xmega AVR
Date: Wed, 4 Feb 2009 10:52:16 -0800

The Xmega support involves a convoluted mechanism to update the SP after a var-arg procedure call.

                                  return (AS2 (mov,__tmp_reg__,r24)  CR_TAB

+                                               AS2 (ldi,r24,0xD8)         CR_TAB

+                                               AS2 (out,__CCP__,r24)      CR_TAB

+                                               AS2 (mov,r24,__tmp_reg__)  CR_TAB

+                                               AS2 (out,__SP_H__,%B1)     CR_TAB

+                                               AS2 (out,__SP_L__,%A1));

 

I presume the CPP was used was to get atomic update of the SP.  however, I am not finding anything in the documentation that indicates that is necessary.    In fact, the XMEGA A manual, page9, section 3.8 states that NOTHING is needed other than writing the SPL first (writing SPL disables interrupts for four cycles).  So what should really happen is:

 

                                  return (  AS2 (out,__SP_L__,%B1)     CR_TAB

+                                               AS2 (out,__SP_H__,%A1));

 


reply via email to

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