Re: bsd versus linux device drivers

From: vehemens <vehemens_at_verizon.net>
Date: Mon, 08 Sep 2008 03:50:41 -0700
On Monday 08 September 2008 03:04:15 am Kostik Belousov wrote:
> On Mon, Sep 08, 2008 at 02:02:00AM -0700, vehemens wrote:
> > In linux drivers, there is a one to one relationship to an open and a
> > calling argument structure called struct file.  It provides a private
> > data pointer that allows the driver to preserve unique state information
> > across other calls such as read/write/ioctl/mmap/close etc.
> >
> > For bsd drivers, my understanding there is not an equivalent.  As a
> > result it is not possible to preserve different state information for
> > multiple opens by the same thread of the same device major/minor #'s.
> >
> > Is this correct, or did i miss something?
>
> There is devfs_{get,set}_cdevpriv() KPI. Still no manpage, I shall fix
> this ASAP.

Just started looking at the firewire driver which has clone.  It looks like it 
hooks into the event handler.

Don't quite understand it all yet, so I'm going to look forward to that man 
page.
Received on Mon Sep 08 2008 - 08:45:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:35 UTC