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

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

Re: [avr-gcc-list] Re: "progmem_far" attribute


From: Andy H
Subject: Re: [avr-gcc-list] Re: "progmem_far" attribute
Date: Sun, 20 Jul 2008 20:59:28 -0400
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

It gets quite confusing.

Anatoly decribes a method to allow an addition 64K bytes of space for progmem data. As this is limited to 64K bytes even for 128 devices.
(since pointers are byte pointers)

For functions, pointers are words - so 64Kwords or 128K bytes is ok for 128 devices - but not for 256K devices.

My objection to far, was for Anatoly's patch - as this is only a separate space. So I suggested high/low or perhaps even upper/lower or space1/2. "far" normal means an attribute that allow access to any part of memory - eg big pointer.








Jim Brain wrote:
Andy H wrote:
Yes this should be more than enough for data!

I am happy with "high" or anything that is not "far".
I am more than happy to be way off base, but the libraries looks to already be using _far:

When I ported some code recently from M644(p) to M1281, I had to fix this:

#if FLASHEND > 0xffff
 for(i = 0;i < sizeof(bootldrinfo_t);i++) {
((uint8_t*)&current_bootldrinfo)[i] = pgm_read_byte_far(FLASHEND - BOOTLDRSIZE - sizeof(bootldrinfo_t) + 1 + i);
 }
#else
memcpy_P(&current_bootldrinfo, (uint8_t*) FLASHEND - BOOTLDRSIZE - sizeof(bootldrinfo_t) + 1, sizeof(bootldrinfo_t));
#endif


If I'm correct, I think developers such as myself would expect the functions to be _near and _far, with an alias of _near to the old function name for larger devices like the 128/1280/1281/...

Of course, please ignore if I've misunderstood things.

Jim





reply via email to

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