From owner-freebsd-arch@FreeBSD.ORG Tue Sep 20 15:55:58 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 846B116A41F; Tue, 20 Sep 2005 15:55:58 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from mail.qubesoft.com (gate.qubesoft.com [217.169.36.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4D0443D4C; Tue, 20 Sep 2005 15:55:57 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from [192.168.1.254] (dhcp254.qubesoft.com [192.168.1.254]) by mail.qubesoft.com (8.13.3/8.13.3) with ESMTP id j8KFttB8069467; Tue, 20 Sep 2005 16:55:55 +0100 (BST) (envelope-from dfr@nlsystems.com) In-Reply-To: <200509201045.58685.jhb@FreeBSD.org> References: <5975.1127215219@critter.freebsd.dk> <200509201045.58685.jhb@FreeBSD.org> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <76404F68-547C-42E2-A3A9-BD0AF2ECFADF@nlsystems.com> Content-Transfer-Encoding: 7bit From: Doug Rabson Date: Tue, 20 Sep 2005 16:55:54 +0100 To: John Baldwin X-Mailer: Apple Mail (2.734) X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.0.4 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.qubesoft.com X-Virus-Scanned: ClamAV 0.86.2/1091/Tue Sep 20 14:59:01 2005 on mail.qubesoft.com X-Virus-Status: Clean Cc: Poul-Henning Kamp , freebsd-arch@freebsd.org Subject: Re: Improving bus/resource API X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2005 15:55:58 -0000 On 20 Sep 2005, at 15:45, John Baldwin wrote: > On Tuesday 20 September 2005 07:20 am, Poul-Henning Kamp wrote: > >> The patch below improves the bus/resource API such that between 10 >> and 20 lines of code can be eliminated from the attach/detach >> functions of the average device driver. >> >> Therefore the best place to start is to read what the patch does >> to if_sis.c, which is a very typical case. >> >> The patch is backwards compatible in binary and source form so >> it is a potential candidate for RELENG_6 at some point. >> >> Compile tested on i386/amd64 and sparc64. My alpha will be chewing >> on it for the forseeable future. >> >> >> For sanity in the ensuing bikeshed, let's take three topics in >> this order: >> >> 1. "what this does to the device driver sources." >> >> 2. "what this does to the rman/bus internals" >> >> 3. "suggestions for different function names" >> > > I'll only comment on 3) > > Maybe bus_read_{1,2,4}() rather than bsr_? (Same with s/bsw_/ > bus_write_/). I > do like having the accessors take just a resource rather than a > tag, handle > pair. Many drivers already hide this in wrapper macros already > though. > > For the dwiw (dwim? :-P) maybe since it takes an array, just make the > 'resource' part plural, thus 'bus_alloc_resources()' and > 'bus_release_resources()'? I like these names.