From owner-freebsd-current@FreeBSD.ORG Thu Feb 2 22:33:20 2006 Return-Path: X-Original-To: freebsd-current@www.freebsd.org Delivered-To: freebsd-current@www.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD28316A420 for ; Thu, 2 Feb 2006 22:33:20 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 328EF43D49 for ; Thu, 2 Feb 2006 22:33:18 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k12MX9I4043105; Thu, 2 Feb 2006 15:33:10 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <43E288B0.6080804@samsco.org> Date: Thu, 02 Feb 2006 15:33:20 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20051230 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Gallatin References: <17378.34270.630897.473143@grasshopper.cs.duke.edu> In-Reply-To: <17378.34270.630897.473143@grasshopper.cs.duke.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: freebsd-current@www.freebsd.org Subject: Re: mapping "random" physical memory into kernel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2006 22:33:20 -0000 Andrew Gallatin wrote: > Can somebody please remind me what the supported way to establish a > kernel virtual address for a "random" chunk of physical memory is? > I'm currently using pmap_mapdev() directly, but that just feels > dirty... > > I need to twiddle the settings of an Nvidia NF4 bridge in extended > PCI config space (offset 0x178). These offsets are not accessible > via normal pci config space writes, but are doable when you use the > 0xe000000 mapping. Extended pci config space is supported by default on i386, but I haven't gotten around to figuring out the right strategy for amd64. I'd like to be able to map the entire 256MB range instead of the on-demand approach with i386, but I need to learn more about the various VM maps on amd64 first. > > The problem is that this memory is not really associated with > anything, so a normal bus_alloc_resource() allocation doesn't > seem like it would work. pmap_mapdev is the correct interface for this. Scott