public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC embedded c proposal
@ 2004-04-29 11:25 Svein E. Seldal
  2004-04-29 11:57 ` Paolo Bonzini
  2004-04-29 12:51 ` Giovanni Bajo
  0 siblings, 2 replies; 4+ messages in thread
From: Svein E. Seldal @ 2004-04-29 11:25 UTC (permalink / raw)
  To: gcc

Hi,

I'm working on a patch on [AVR-]GCC to support multiple memoryspaces. 
The AVR has more than one memoryspace (code + data), and thus a 
modification to GCC is needed.

This standard proposal from ISO/IEC:

   http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n1021.pdf

contains issues about C extension in respect of embedded processors. In 
section 3.1.2. it suggests syntax for multiple memoryspaces:

	_X char a, b, c;
		// Declares three characters in address space _X

	_X const int *p;
		// Declares a pointer in the generic address space
		// that points to a constant int object in address
		// space _X

	_X struct { int a; char b; } *_Y q;
		// Declares a pointer in address space _Y that points
		// to a structure in address space _X

Now, if I were to implement this into GCC, what would be best method of 
  implementation? Consider:

a) Add the appropriate _X keywords for the target at hand (which in this 
case could be _Progmem, _Flash, _Code or similar)

*or*

b) Declare an __attribute__, e.g. __attribute__((progmem)), that will 
become a part of the type decleration:

	__attribute__((progmem)) char a, b, c;  // Works today in GCC

	__attribute__((progmem)) int *p;        // Does not work


Which of these two methods would be best suited for gcc?


Regards,
Svein

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-29 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-29 11:25 RFC embedded c proposal Svein E. Seldal
2004-04-29 11:57 ` Paolo Bonzini
2004-04-29 12:51 ` Giovanni Bajo
2004-04-29 16:19   ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).