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

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Fri Aug 21 06:29:14 EDT 2015


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.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



More information about the Info-vax mailing list