The memory ranges that a driver can access for DMA and memory-mapped I/O are determined by the device capabilities, the O/S version, and the DDI version.
DDI 8 and later drivers
that use the BA_SCGTH flag
can access memory above 4GB
if they set the
dma_physize in their
structure to use the 64-bit version of
the scatter/gather structure.
For earlier DDI versions, the operating system copies to and from buffers below 4GB, transparently to the drivers and filesystems. This bounce-buffer-copy scheme is also used for 24-bit and 32-bit devices. Drivers that use memory-mapped I/O and other non-DMA schemes use virtual addresses rather than physical, so theoretically the bounce-buffer-copy scheme is not required, but it must be used because these drivers can call the vtop(D3) function, which can only return 32-bit values.
DDI 8 and later version drivers can use the devmem_mapin(D3) function to allocate a virtual address mapping for a range of device memory addresses to be used for memory-mapped I/O. devmem_mapin( ) can use memory addresses greater than 4GB, although current BIOSes never assign PCI memory about 4 GB. map in a contiguous chunk of memory
See ``DMA'', ``Memory-mapped I/O'', and ``Scatter/gather operations''.