EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Question regarding the usage of devlib2
From: Michael Davidsaver <[email protected]>
To: Jörn Dreyer <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Fri, 4 May 2018 12:20:19 -0700
On 05/04/2018 05:07 AM, Jörn Dreyer wrote:
> I am currently working on a driver for a PCI card. To access this card I have 
> writen a small uio kernel driver for Linux based on the concept from mrfio2. 

Did you see the 'uio_pci_generic' driver which comes with Linux, and my
'pci_generic_msi' variant in devlib2?

> In the asynDriver that I'm working on I use devlib2 to get access to the 
> mapped memory regions of the card following the concept of evrMrmApp from 
> mrfio2.  In mrfCommon a lot of macros (BITSET, BITCLR, READS and WRITE for 
> various bitwidth) are defined. 

Which ones would you find useful?  I didn't port them over because, in hindsight
I'm not sure they were so helpful to me.

The original goal was to prevent unintentional access with an incorrect width.
eg. Using a 32-bit read of a 16-bit register.  In practice with mrfioc2
this was a waste.  Due to the strict recipe needed to work with both vme and pci,
only 32-bit reads could be used.

Also in hindsight, the BITSET/CLR read-modify-write macros are a recipe for
race conditions if used without preventing concurrent access (eg. interrupt
disable or mutex).  This convenience was a little too convenient.

> Should these macros not be part of devlib2? This way other modules could 
> profit from this work much easier. Pulling these files into my project would 
> require to install the mrfio2 module even if I do not have the hardware. Not 
> thinking about license conflicts that might arise if I copy the code over to 
> my project.

mrfioc2 uses the same EPICS open license as devlib2, and Base itself.  So I
don't think that this aspect will make your life more complicated than it
already is (if you're thinking about licensing).

> Regards,
> Jörn Dreyer
> 


Replies:
RE: Question regarding the usage of devlib2 Kline, David
Re: Question regarding the usage of devlib2 Jörn Dreyer
References:
Question regarding the usage of devlib2 Jörn Dreyer

Navigate by Date:
Prev: Job Opening at Fermilab, Accelerator Controls Dennis Nicklaus
Next: RE: Question regarding the usage of devlib2 Kline, David
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Question regarding the usage of devlib2 Jörn Dreyer
Next: RE: Question regarding the usage of devlib2 Kline, David
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 07 May 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·