From owner-freebsd-hackers Mon Oct 27 12:20:57 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA21673 for hackers-outgoing; Mon, 27 Oct 1997 12:20:57 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from ns.mt.sri.com (SRI-56K-FR.mt.net [206.127.65.42]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA21654 for ; Mon, 27 Oct 1997 12:20:49 -0800 (PST) (envelope-from nate@rocky.mt.sri.com) Received: from rocky.mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.8.7/8.8.7) with ESMTP id NAA15744; Mon, 27 Oct 1997 13:20:21 -0700 (MST) Received: (from nate@localhost) by rocky.mt.sri.com (8.7.5/8.7.3) id NAA02166; Mon, 27 Oct 1997 13:20:18 -0700 (MST) Date: Mon, 27 Oct 1997 13:20:18 -0700 (MST) Message-Id: <199710272020.NAA02166@rocky.mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Terry Lambert Cc: luigi@labinfo.iet.unipi.it (Luigi Rizzo), hackers@freebsd.org Subject: Re: a question about LKM In-Reply-To: <199710271843.LAA24331@usr04.primenet.com> References: <199710270641.HAA03134@labinfo.iet.unipi.it> <199710271843.LAA24331@usr04.primenet.com> X-Mailer: VM 6.29 under 19.15 XEmacs Lucid Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > I am looking at how ot make my audio driver an LKM. > > > > I have seen some examples of LKMs but none of them uses interrupts. > > As a consequence, I am a bit unclear on what actions should be done > > at load time (and especially, at unload time) so that interrupts > > are properly delivered. For the attach part i can probably figure > > it out -- just do the standard attach() action -- but what for the > > detach ? > > Look at the PCCARD code (it has to detach things as well). It's full of races, but I don't think there is a way around given that 'detach' happens w/out any event signalling it's going to occur. Because of that, most of the stuff is left 'lying around' in case the kernel is in the middle of doing something. Also, most of the kernel doesn't allow 'giving back' resources. Nate