comp.lang.ada
 help / color / mirror / Atom feed
From: dkristol@see-my.sig (David Kristola)
Subject: Re: Caching & Annex C.6
Date: 1999/09/08
Date: 1999-09-08T00:00:00+00:00	[thread overview]
Message-ID: <7r4ted$e892@svlss.lmms.lmco.com> (raw)
In-Reply-To: 7r4fao$h7o$1@nnrp1.deja.com

In article 1@nnrp1.deja.com, Robert Dewar <robert_dewar@my-deja.com> () writes:
>In article <7r1l93$9lq4@svlss.lmms.lmco.com>,
>  dkristol@see-my.sig wrote:
>> I work with real-time embedded systems, and we use pragma
>> Volatile to mark variables that represent (and are located
>> on) memory mapped registers.  The data must be written to
>> the memory mapped register when that code executes.
>> Likewise, many of those registers return values set by
>> hardware, so reads can't come from the cache.
>
>But usually the ensurance of non-caching of these addresses
>will be done at the hardware level, it is not something the
>compiler worries about. The compiler's responsibility is
>simply to issue loads and stores, someone else must make
>sure that the loads and stores work as planned (for example
>on the MIPS one bit of the address space is used to indicate
>cachability). There are machines with different loads and
>stores to control caching, but not many!

True.  Those memory mapped register variables are also
placed at the correct location using the uncached
address in the representation specification.

And after being burned by one compiler, i started using
appropriately sized integers for the register overlay,
and calling unchecked conversion to convert the data
to the register's record structure.  This eliminated
the compiler's optimization which inadvertently read and
wrote bytes on either side of the register.  Those bytes
happened to be parts of other registers, and the hardware
did not handle byte access properly.  That particular bug
took a while to track down.


--djk, keeper of arcane lore & trivial fluff
Home: David95037 at aol dot com
Spam: goto.hades@welovespam.com





  reply	other threads:[~1999-09-08  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-03  0:00 Caching & Annex C.6 Simon Wright
1999-09-05  0:00 ` Robert Dewar
1999-09-05  0:00   ` Simon Wright
1999-09-07  0:00 ` David Kristola
1999-09-08  0:00   ` Robert Dewar
1999-09-08  0:00     ` David Kristola [this message]
1999-09-08  0:00       ` Robert Dewar
1999-09-09  0:00         ` Memory mapped registers (was Re: Caching & Annex C.6) David Kristola
1999-09-09  0:00           ` Robert Dewar
1999-09-14  0:00             ` Memory mapped registers (was Re: Cachi David Kristola
1999-09-14  0:00               ` Robert Dewar
1999-09-15  0:00                 ` David Kristola
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox