Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 1997 09:34:57 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        bde@zeta.org.au, hackers@freebsd.org
Subject:   Re: Unloading LKMs (was Re: A Desparate Plea for Help...)
Message-ID:  <Pine.BSF.3.95q.970430093208.13137K-100000@herring.nlsystems.com>
In-Reply-To: <199704300744.RAA27463@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 30 Apr 1997, Michael Smith wrote:

> > For unloading, the driver registers itself as a module.  This involves
> > supplying an event callback in a similar way to the LKM system.  When the
> > user attempts to unload the driver, the module gets an UNLOAD event which
> > it can use to clean up *devsw, devfs, interrupts etc.  If it can't for
> > some reason, it can veto the unload by returning EBUSY.
> 
> Ok.  Do you have infrastructure for cleaning up devsw entries automagically?
> eg. a hook the module can call to say "these *devsw entries are mine"
> so that you can back the module out when you unload it?

What I have at the moment is some handy macros in isa_device.h which spit
out all the code and SYSINIT declarations to register the device at
load/boot time and clean up at unload time.  For 95% of drivers, this will
be enough.  Since the module gets called at unload time, any weird drivers
can implement their own module event handler to do their own special
stuff.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970430093208.13137K-100000>