Re: User mode drivers: part 2: PCI device handling (patch 1/2 for2.6.11)

From: Alan Cox
Date: Mon Mar 14 2005 - 12:58:43 EST


On Llu, 2005-03-14 at 00:13, Peter Chubb wrote:
> Greg> see mmap(2)
>
> mmap maps a file's contents into your own virtual memory.
> usr_pci_map maps part of your own virtual memory into pci bus space
> for a particular device (using the IOMMU if your machine has one), and
> returns a scatterlist of bus addresses to hand to the device.

You can't really do it that way around because you don't know what the
memory constraints of the device are compared to your user pages.
Suppose your user pages are in high memory over 4GB and the device is
32bit DMA constrained ? You don't want bounce buffers clearly.

In addition you have to be very careful about shared pages when doing
DMA because you don't want to DMA into a COW page but that is handleable
(as is done by O_DIRECT)

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/