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

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

Re: [avr-libc-dev] Why include <ina90.h> from <avr/pgmspace.h>?


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] Why include <ina90.h> from <avr/pgmspace.h>?
Date: Tue, 8 Oct 2002 09:55:43 +0200
User-agent: Mutt/1.2.5i

[Marek & Denis: please see below for a specific question, that's
why i've set you on Cc.]

As E. Weddington wrote:

> > Both are not the same, i think.  Does gcc automatically set RAMPZ?

> RAMPZ is defined in the specific ioXXXX.h file. Doing a grep, it's 
> defined for the mega103 (iom103.h) and the mega128 (iom128.h).

Sorry, i was not clear. :-)  Sure, i knew this.

My question was whether when accessing an __attribute__((progmem))
string, would gcc automatically set the appropriate value in RAMPZ, or
is it in the domain of the programmer to do so.  If gcc doesn't handle
this automatically, i don't see why one should always use ELPM on >
64KB devices.

Btw., unfortunately, there's no different architecture name for > 64K
devices (only a distinction for <= 8KB and > 8KB since the latter
require JMP/CALL instead of RJMP/RCALL to cover the entire address
space), thus the existence of RAMPZ & ELPM cannot be automatically
determined inside library code anyway (since there's only one library
version per architecture).  This, for example, will restrict the
impending printf_p() implementation from accessing format strings
beyond 64 KB.  Perhaps we should invent avr6 for avr5 devices with
more than 64 KB of RAM?

Given that AVR's flash is organized by 16-bit words, i don't quite
understand why they didn't use word addressing.  This would have saved
us the nuisance of RAMPZ for 128KB devices...

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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