mapping "random" physical memory into kernel

Scott Long scottl at samsco.org
Thu Feb 2 14:33:20 PST 2006


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


More information about the freebsd-current mailing list