From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Pragma Volatile
Date: Sun, 30 Sep 2001 21:19:17 GMT
Date: 2001-09-30T21:19:17+00:00 [thread overview]
Message-ID: <3BB78C4D.66484277@acm.org> (raw)
In-Reply-To: 5ee5b646.0109300510.71255128@posting.google.com
Robert Dewar wrote:
>
> Jeffrey Carter <jrcarter@acm.org> wrote in message news:<3BB64B13.81AFFB4D@acm.org>...
> > If a register is an Integer, I would generally do
> >
> > B : Integer;
> > for B'Address use Register_Location;
> > pragma Volatile (B);
> > ...
> > B := 0;
> > B := 1;
> >
> > But then, I don't have the C pointer fixation.
>
> Be very careful about assumptions here. Suppose that
> B is a 32-bit word, then there is nothing in the language
> that says that
>
> B := 0;
>
> has to generate a 32-bit store, it would be perfectly
> valid if the compiler generated a call to bcopy that
> moved four bytes independently (inefficient, but not
> incorrect).
Thanks again to Robert Dewar for pointing out implicit assumptions.
I was actually responding to Corey Minyard's implicit assumption that a
pointer was needed to access a memory-mapped hardware register.
--
Jeff Carter
"Monsieur Arthur King, who has the brain of a duck, you know."
Monty Python & the Holy Grail
next prev parent reply other threads:[~2001-09-30 21:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-25 14:07 Pragma Volatile Jon R. Harshaw
2001-09-25 14:23 ` David C. Hoos
2001-09-25 14:38 ` Marin David Condic
2001-09-25 23:03 ` Mark Johnson
2001-09-29 17:38 ` Tucker Taft
2001-09-29 18:22 ` minyard
2001-09-29 22:28 ` Jeffrey Carter
2001-09-30 13:10 ` Robert Dewar
2001-09-30 21:19 ` Jeffrey Carter [this message]
2001-10-01 2:58 ` minyard
2001-10-02 9:38 ` AG
2001-10-02 10:59 ` Jeff Creem
2001-09-30 2:03 ` DuckE
2001-09-30 13:01 ` Robert Dewar
2001-09-30 20:12 ` minyard
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox