> > > It may be a compiler optimisation.
> > 
> > i think all memory-mapped registers should be declared "volatile" to
> > avoid such things occur. I remember when i was looking at both the
> > meteor and bt848 drivers, there was some confusion about it.
> 
> Depending on when you looked, the stuff you excepted below probably
> didn't exist.  It's been more than a year now, I think, but I
> introduced the macro and associated typedef when I changed the driver

very likely. i have been using a home-grown bt848 driver (derived from
some early version of the official one) for some time until the time i
switched to 2.2.6.

In any case: the use of "volatile" seems correct now so i wonder why/if
the compiler "optimizes" out the sequence

        bt848->tdec = 0;
        bt848->tdec = something;

or perhaps is the bt848 chip which requires some time to detect&react
to the first write (and if i remember well, the data sheets are
extremely confused on this register).

        cheers
        luigi
-----------------------------------+-------------------------------------
  Luigi RIZZO, lu...@iet.unipi.it  . Dip. di Ing. dell'Informazione
  http://www.iet.unipi.it/~luigi/  . Universita` di Pisa
  TEL/FAX: +39-050-568.533/522     . via Diotisalvi 2, 56126 PISA (Italy)

                  http://www.iet.unipi.it/~luigi/ngc99/
====  First International Workshop on Networked Group Communication  ====
-----------------------------------+-------------------------------------


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to