Re: Expected compiler error on GENERIC?




David O'Brien writes:
> On Thu, Mar 21, 2002 at 09:31:30AM -0500, Andrew Gallatin wrote:
> > David O'Brien writes:
> > > On Wed, Mar 20, 2002 at 04:13:06PM -0700, Warner Losh wrote:
> > > > The line in question is
> > > > if (!badaddr((void *)&t2_csr[1]->tlbbr, sizeof(long))) {
> > > > but I don't know what the type of tlbbr is, but it is either volatile
> > > > or const for some reason...
> > >
> > > `tlbbr' is u_long.
> > > `t2_csr' is "volatile", and is the source of the warning.
> >
> > Please: what's the proper way to cast away the volatile & shut the
> > f*ing compiler up?
>
> Why is it marked "volatile" in the first place? What will happen if we

Because its sitting in hardware & other elemnets of the struct are
accessed in ways where I want to preserve ordering.

> make a 'u_long ltmp = t2_csr[1]->tlbbr;' and then pass in the address of
> that? Will we potentially be using a stale value that could cause us a
> problem?


__DEVOLATILE is what I was looking for.

Drew


To Unsubscribe: send mail to majordomo@xxxxxxxxxxx
with "unsubscribe freebsd-alpha" in the body of the message



...



Privacy