Date: Mon, 18 Aug 2003 23:47:06 -0400 From: "Brian J. McGovern" <mcgovern@beta.com> To: hackers@freebsd.org Subject: Allocating memory from PCI bus... Message-ID: <200308190347.h7J3l6X7073480@spoon.beta.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308190347.h7J3l6X7073480>
