From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 27 16:50:56 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43BEC16A4CE for ; Tue, 27 Jul 2004 16:50:56 +0000 (GMT) Received: from msgbas2x.cos.agilent.com (msgbas2x.cos.agilent.com [192.25.240.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A9CC43D31 for ; Tue, 27 Jul 2004 16:50:56 +0000 (GMT) (envelope-from chuck_tuffli@agilent.com) Received: from enccos4.cos.agilent.com (enccos4.cos.agilent.com [130.29.152.93]) by msgbas2x.cos.agilent.com (Postfix) with SMTP id 6D6A07F9D; Tue, 27 Jul 2004 10:50:55 -0600 (MDT) Received: from relcos1.cos.agilent.com (130.29.152.239) by enccos4.cos.agilent.com (Sigaba Gateway v3.83) with ESMTP id 17118770; Tue, 27 Jul 2004 10:51:20 -0600 Received: from rtl.rose.agilent.com (rtl.rose.agilent.com [130.30.179.189]) by relcos1.cos.agilent.com (Postfix) with ESMTP id 09BFF15E; Tue, 27 Jul 2004 10:50:55 -0600 (MDT) Received: from cre85086tuf.rose.agilent.com (cre85086tuf [130.30.174.150]) ESMTP id JAA19892; Tue, 27 Jul 2004 09:50:51 -0700 (PDT) Received: by cre85086tuf.rose.agilent.com (Postfix, from userid 1001) id 3D15419E2B6; Tue, 27 Jul 2004 09:51:25 -0700 (PDT) Date: Tue, 27 Jul 2004 09:51:25 -0700 From: Chuck Tuffli To: "M. Warner Losh" , Jake Burkholder Message-ID: <20040727165124.GA64121@cre85086tuf.rose.agilent.com> References: <20040727015923.GA63284@cre85086tuf.rose.agilent.com> <20040726.215453.22504137.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040726.215453.22504137.imp@bsdimp.com> User-Agent: Mutt/1.4i cc: hackers@freebsd.org Subject: Re: bus_alloc_resource question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 16:50:56 -0000 On Mon, Jul 26, 2004 at 09:54:53PM -0600, M. Warner Losh wrote: ... > Generally, one doesn't need to set the resource value. Doing so > usually indicates the presence of some bug in the system. Also, just I realize now that the original email wasn't clear. This is a bus driver for a new bus. Think of the physical addresses from 0xe0000000 - 0xefffffff as being a memory mapped config space for devices. Each 4KB segment of this region maps the configuration space for every possible bus, device, function number combination. I was thinking that each of these segments was a bus resource, but maybe that isn't the right approach. Any thoughts as to a better approach? Jake Burkholder suggested using pmap_mapdev() for small sections of memory, but cautioned that this uses up virtual address space. The bus driver could map each segment to test if a device was there and unmap the segments that didn't contain devices. -- Chuck Tuffli Agilent Technologies, Storage Area Networking