Allocating memory from PCI bus...

Brian J. McGovern mcgovern at beta.com
Mon Aug 18 20:40:15 PDT 2003


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



More information about the freebsd-hackers mailing list