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)); 

 

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to