From owner-freebsd-current@FreeBSD.ORG Wed Nov 3 22:12:52 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 339B1106564A; Wed, 3 Nov 2010 22:12:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 395DB8FC13; Wed, 3 Nov 2010 22:12:50 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAIZ70UyDaFvO/2dsb2JhbACDI583r1ORFoEigzFzBIUPhUaFCg X-IronPort-AV: E=Sophos;i="4.58,291,1286164800"; d="scan'208";a="97703628" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 03 Nov 2010 18:12:50 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 05929B3F53; Wed, 3 Nov 2010 18:12:50 -0400 (EDT) Date: Wed, 3 Nov 2010 18:12:50 -0400 (EDT) From: Rick Macklem To: Julian Elischer Message-ID: <223810140.57555.1288822369961.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <4CD1DBE8.7090200@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [99.225.56.115] X-Mailer: Zimbra 6.0.7_GA_2476.RHEL4 (ZimbraWebClient - IE8 (Win)/6.0.7_GA_2473.RHEL4_64) Cc: mdf@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon 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 22:12:52 -0000 > On 11/3/10 2:56 PM, Rick Macklem wrote: > >>> Is there any documentation on best practices for writing a FreeBSD > >>> driver? > >> Not really. :-/ > >> > > Just a dumb obvious suggestion. Imho, there is no better doc. than > > some > > well written code, so maybe someone familiar with the drivers can > > suggest > > one (or two) that they consider well written and use the current > > conventions > > as "examples"? > > we try every now and then to put good examples in /usr/share/examples > but I think what's there is hopelessly out of date. > Yep, that's the inevitable problem with this kind of doc. What I was suggesting was to list a couple of the current drivers in src/sys as good examples of "best practice" and hope they stay current, if they're in the kernel source tree and being used for current hardware. But, just a suggestion (and the "list" could/will get out of date someday), rick