From owner-freebsd-arch@FreeBSD.ORG Wed Apr 19 22:04:26 2006 Return-Path: X-Original-To: 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 DD15616A42C for ; Wed, 19 Apr 2006 22:04:26 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4196643D6B for ; Wed, 19 Apr 2006 22:04:02 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gqn537exnlm16obx@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.4/8.13.3) with ESMTP id k3JM41lV089191 for ; Wed, 19 Apr 2006 15:04:01 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.4/8.13.3/Submit) id k3JM416Z089190 for arch@FreeBSD.org; Wed, 19 Apr 2006 15:04:01 -0700 (PDT) (envelope-from jmg) Date: Wed, 19 Apr 2006 15:04:01 -0700 From: John-Mark Gurney To: arch@FreeBSD.org Message-ID: <20060419220401.GO38619@funkthat.com> Mail-Followup-To: arch@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: Subject: remove rid pointer (but not rid)... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2006 22:04:27 -0000 I was looking at our interface, and realized that since we now have rman_get_rid, that passing in a rid pointer to bus_alloc_resource is out dated... you can get the new updated rid directly from the resource returned... This will benifit bus_alloc_resources, as we can constify the _spec parameter, to make driver writing simpler... We can also reduce the use of the type parameter by including it as part of the resource, and then eliminate that parameter from the release, free cases... I have briefly discussed this w/ jhb, phk and imp, and they agree that this should be fixed... My new proposed prototypes: # this is the bus_if.m: static struct resource *bus_alloc_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long end, u_long count, u_int flags) from bus.h: int bus_alloc_resources(device_t dev, const struct resource_spec *rs, struct resource **res); void bus_release_resources(device_t dev, const struct resource_spec *rs, struct resource **res); struct resource *bus_alloc_resource(device_t dev, int type, int rid, u_long start, u_long end, u_long count, u_int flags); int bus_activate_resource(device_t dev, struct resource *r); int bus_deactivate_resource(device_t dev, struct resource *r); int bus_release_resource(device_t dev, struct resource *r); int bus_free_resource(device_t dev, struct resource *r); we'll add a couple more functions: int rman_get_restype(struct resource *); void rman_set_restype(struct resource *, int); and of course add the appropriate field to resource_i... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."