From owner-freebsd-current@FreeBSD.ORG Wed Nov 3 17:23:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A613D106566C; Wed, 3 Nov 2010 17:23:50 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BDF198FC1E; Wed, 3 Nov 2010 17:23:49 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA11996; Wed, 03 Nov 2010 19:23:48 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4CD19AA3.3070106@icyb.net.ua> Date: Wed, 03 Nov 2010 19:23:47 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.11) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.5 MIME-Version: 1.0 To: mdf@freebsd.org References: <4CD190EF.5080600@icyb.net.ua> <20101103171101.GS2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101103171101.GS2392@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , freebsd-current@freebsd.org Subject: Re: MTX_DEF versus MTX_SPIN X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2010 17:23:50 -0000 on 03/11/2010 19:11 Kostik Belousov said the following: > On Wed, Nov 03, 2010 at 10:04:13AM -0700, mdf@freebsd.org wrote: >> Is there any documentation on best practices for writing a FreeBSD driver? > Not that I am aware of. You can read locking(9) in HEAD to get the answer > on your question about spin mutexes. BTW, I think that BUS_SETUP_INTR(9) contains the most up to date information on interrupt handling piece of a driver. Unlike e.g. ithread(9). -- Andriy Gapon