avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] [patch #6352] Far pointer library


From: Jan Waclawek
Subject: [avr-libc-dev] [patch #6352] Far pointer library
Date: Wed, 30 Jun 2010 12:50:08 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)

Follow-up Comment #6, patch #6352 (project avr-libc):

The xxx_PF() functions modify the RAMPZ register, but on XMegas with EBI,
RAMPZ influences also LD/LDD/ST/STD, making code after using xxx_PF() to
access unintended data memory "pages".


In the attached file, in macros.inc, macro LPM_R0_ZPLUS_INIT is modified and
macro LPM_R0_ZPLUS_FINI added, storing and restoring RAMPZ, for targets with
__AVR_HAVE_RAMPD__ defined (which IMHO is unique indication of presence of
EBI). Only LPM_R0_ZPLUS_FINI needs to be added to xxx_PF() functions (and
documentation modified accordingly), as shown in the attached memcpy_PF(). All
the xxx_PF() functions are affected and should be modified accordingly after
consensus happens.


As a cheaper alternative, RAMPZ could be simply zeroed as all "standard" RAM
access in current avr-gcc is restricted to 16-bit addresses; whether this is a
better option I leave to decide for the more experienced developers on this
forum.


This resolves https://savannah.nongnu.org/bugs/?func=detailitem&item_id=25120
which thus could be closed as duplicate (the issue with RAMPZ mods being
non-interrupt safe is resolved by saving RAMPZ in the standard interrupt
prologue/epilogue as of avr-gcc version 4.3+).


(file #20859)
    _______________________________________________________

Additional Item Attachment:

File name: memcpy_PF.zip                  Size:5 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6352>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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