[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: C question



On Sat, Mar 03, 2007 at 11:57:36PM +0000, carzrgr8@xxxxxxxxxxxxx wrote:
> 
> Anyway, I was trying to get the compiler to generate 2 versions of
> an initialized array: ROM, and RAM.

Declaring something const might do it, although some architectures like
AVR address ROM and RAM differently, so you have to pay attention.

The only way to be sure that data goes were you want it is to write a
linker script.  That will ensure that all of the data and code is
organized the way you want.  For example, for a network card I organized
all of the primary functionality into a 'cached' section and used a
link script to group that section together.  By using one contiguous
block of memory the processor is able to keep all of the code in its
L1 icache.

-- 
Ben Jackson AD7GD
<ben@xxxxxxx>
http://www.ben.com/


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user