PCI bus-master DMA
PCI bus-master DMA
- Subject: PCI bus-master DMA
- From: "Scott D. Davilla" <email@hidden>
- Date: Mon, 10 Aug 2009 01:50:26 -0400
I'm writing a kext driver for a pci-e hardware device and have a few
questions. The driver needs to setup for a DMA in/out of user space
using a scatter/gather list located in host memory. I've reviewed the
example code and several kext drivers that do similar things and this
operation seems very simple using IODMACommand compared to an
existing Linux driver.
The example (AppleSamplePCI) uses gen64IOVMSegments/gen32IOVMSegments
to prepare a IOMemoryDescriptor for DMA and seems to be able to map
everything into one contiguous physical segment. Seems like magic as
the Linux driver need to map a passed user memory area into many
physical pages. The hardware can handle both flavors but needs to
read the scatter/gather list from host memory. This will be a Intel
only deployment.
Does it really work this way? What does the actual address
translation to physical pages? Something has to re-map a memory
access from the pci-e hardware to the correct physical pages.
What about the offset to the user data within a page? Is this also
handled transparently with IODMACommand?
Is there any advantage to mapping to one vs several contiguous
physical segment? That is, if I request one physical segment or
n-segments when each is a page-size.
Any words of wisdom that I should be aware of?
Thanks
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden