From owner-freebsd-arch@FreeBSD.ORG Tue Sep 20 20:39:38 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 945CF16A42D for ; Tue, 20 Sep 2005 20:39:38 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71CA543D49 for ; Tue, 20 Sep 2005 20:39:37 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.41.233] (Not Verified[10.50.41.233]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Tue, 20 Sep 2005 16:55:25 -0400 From: John Baldwin To: "M. Warner Losh" Date: Tue, 20 Sep 2005 16:08:35 -0400 User-Agent: KMail/1.8 References: <5975.1127215219@critter.freebsd.dk> <76404F68-547C-42E2-A3A9-BD0AF2ECFADF@nlsystems.com> <20050920.130528.35014863.imp@bsdimp.com> In-Reply-To: <20050920.130528.35014863.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509201608.36461.jhb@FreeBSD.org> Cc: phk@phk.freebsd.dk, 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 20:39:38 -0000 On Tuesday 20 September 2005 03:05 pm, M. Warner Losh wrote: > In message: <76404F68-547C-42E2-A3A9-BD0AF2ECFADF@nlsystems.com> > > Doug Rabson writes: > : > 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. > > Are we going to extend this to all the other things that bus space can > do? > http://people.freebsd.org/~imp/bus_space.html > > While many of these are less common than the familiar > bus_space_{read,write}, we should consider them as part of the updated > API. > > bs vs bus_ vs ???. These are really bus space + resource macros. So > maybe we want some other prefix... > > The whole point of the bsr vs bus_space_read was to make things much > shorter. bus_read/write does that, but to a more limited extent. > Still, saving 6 characters per function call, plus one argument will > help a lot. I think maybe just do 's/bus_space_/bus_/' on the current names, which gives the simple bus_read/bus_write for the common case. I think that along with reducing the first two args down to one that should make things shorter without making it cryptic. (I think bsrm_4() would be cryptic compared to bus_read_multi_4().) > : > 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. > > That would settle the whole dwim vs dwiw arguement :-). I like it. > > Oh, I found another bug: There are no man pages. This is the only > fatal problem. There's still no man page, for example, for the d_*_t > functions, nor the cdevsw in general (other than really crunch ones). Now now, it's just a proposal at this stage. :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org