[Info-vax] Volatile, was: Re: yet another sys$qiow question

George Cornelius cornelius at eisner.decus.org
Mon Aug 24 16:00:17 EDT 2015


In article <mr6uhp$cn9$1 at dont-email.me>, Simon Clubley <clubley at remove_me.eisner.decus.org-Earth.UFP> writes:
> On 2015-08-20, JF Mezei <jfmezei.spamnot at vaxination.ca> wrote:
>> Question for Mr VAXman:
>>
>> Since you live/eat/sleep/dream in kernel mode, do you still have to
>> worry about something modifying a variable's value outside of your code ?

> I can tell you have never written a device driver. :-)
> 
> You have to worry about it for every memory mapped device out there.
> 
> That's why all memory mapped device registers are marked as volatile
> in your driver source code.
> 
> It's also why the rules about generated code having the exact same
> number of reads and writes to volatile registers as in the source code
> exist because even reading a device register can have side effects.

Yes, programming on the bare metal on a PDP-11 allows you to read from
the FIFO in an RX211/RXV21 (controller for a double density 8" floppy)
in a loop, with each read advancing one position in the tiny (128 byte)
FIFO.  I disliked the stuff, but it is what it is and allows drivers
that get one interrupt per sector to rapidly move data on certain
devices that do not have DMA (NPR) available.

George



More information about the Info-vax mailing list