PAT_WRITE_COMBINING: how to use?

Andrew Gallatin gallatin at cs.duke.edu
Tue May 29 16:05:03 UTC 2007


I would very much like to obtain a write-combine mapping of PCIe
device memory for mxge(4) without depending on the flakiness of MTRRs.
I currently use bus_alloc_resource() to map my device's memory space,
and then use mem_range_attr_set() to attempt to change the memory to
be write-combine. 

I recently noticed that pmap_mapdev_attr() function on amd64 & i386,
but it looks like nexus_activate_resource() just calls pmap_mapdev(),
which defaults to PAT_UNCACHEABLE.  Would it be possible to add a
flag which could tell the bus_* functions to map the memory
write-combine?

Or should I avoid bus_alloc_resource(), and map my device myself with
pmap_mapdev_attr()?   

Or should I replace my call to mem_range_attr_set() with a call to
pmap_change_attr?

Thanks,

Drew



More information about the freebsd-current mailing list