From owner-freebsd-arch@FreeBSD.ORG Tue Sep 20 19:06:45 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 E928316A41F; Tue, 20 Sep 2005 19:06:45 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F44D43D49; Tue, 20 Sep 2005 19:06:44 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id j8KJ590F040685; Tue, 20 Sep 2005 13:05:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 20 Sep 2005 13:05:28 -0600 (MDT) Message-Id: <20050920.130528.35014863.imp@bsdimp.com> To: dfr@nlsystems.com From: "M. Warner Losh" In-Reply-To: <76404F68-547C-42E2-A3A9-BD0AF2ECFADF@nlsystems.com> References: <5975.1127215219@critter.freebsd.dk> <200509201045.58685.jhb@FreeBSD.org> <76404F68-547C-42E2-A3A9-BD0AF2ECFADF@nlsystems.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 20 Sep 2005 13:05:11 -0600 (MDT) 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 19:06:46 -0000 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. : > 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). Warner