uncached data

Allan Hessenflow allanh-rtems at kallisti.com
Wed Aug 23 22:29:48 UTC 2006


This isn't really RTEMS specific but it seems likely this has come up with
other RTEMS drivers.  I'm trying to decide how to cause some data to be put
in cache safe areas.  For the system I'm using that means the data can be
almost anywhere, but cannot share cache lines with data that could be cached.
For objects that would be allocated from the heap, I think I can just create
a separate region with the appropriate alignment and allocate out of that.
I won't ever be trying to allocate uncached stuff on the stack.  So that
just leaves statically allocated objects.

With gnu tools, I can see two methods of doing this.  One is to specify a
"section" attribute for each object and then use the linker to group it all
together, with appropriate alignment/padding.  This would seem ideal,
except that it doesn't work for uninitialized data so it will waste ROM
space with initial values for objects that don't need them.  Another method
is to specify the alignment for each uncached object, and ensure each object
is large enough to use up space to the end of a cache line.  This will waste
space in RAM, potentially padding before and after every single uncached
object.  Is there some method I'm missing?

allan

-- 
Allan N. Hessenflow      allanh at kallisti.com



More information about the users mailing list