gEDA-user: C question
Ben Jackson
ben at ben.com
Sat Mar 3 19:19:35 EST 2007
On Sat, Mar 03, 2007 at 11:57:36PM +0000, carzrgr8 at optonline.net 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 at ben.com>
http://www.ben.com/
More information about the geda-user
mailing list