From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 18 20:40:15 2003 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 1CA5137B40F for ; Mon, 18 Aug 2003 20:40:15 -0700 (PDT) Received: from spoon.beta.com (spoon.beta.com [199.165.180.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4070B43F3F for ; Mon, 18 Aug 2003 20:40:10 -0700 (PDT) (envelope-from mcgovern@spoon.beta.com) Received: from spoon.beta.com (mcgovern@localhost.beta.com [127.0.0.1]) by spoon.beta.com (8.12.9/8.12.9) with ESMTP id h7J3l6X7073480 for ; Mon, 18 Aug 2003 23:47:06 -0400 (EDT) (envelope-from mcgovern@spoon.beta.com) Message-Id: <200308190347.h7J3l6X7073480@spoon.beta.com> To: hackers@freebsd.org Date: Mon, 18 Aug 2003 23:47:06 -0400 From: "Brian J. McGovern" X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: Allocating memory from PCI bus... 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, 19 Aug 2003 03:40:15 -0000 If anyone whom responds could cc me, I'd appreciate it. I seem to be having a problem making the logic jump in bus resource allocation with FreeBSD 5.x. Its been awhile since I've done driver development (around early 3.x), where you would call pci_map_mem() to get the virtual and physical memory locations of the hardware. In 5.x, it appears that you call bus_alloc_resource() with the rid (BAR) of the memory resource to actually obtain a resource structure to the memory. Would you then call rman_get_virtual() to obtain the virtual address? How about the physical address (use vtophys(rman_get_virtual()) ? Also, can I just make the rman_get_virtual call, or do I need to use rman_init, rman_reserve_resource, etc. to get to this information? Pointers to good documentation also appreciated :) -Brian