I’m writing a Neutrino driver for a PCI card with bus mastering (DMA)
capabilities. The big piece I’m missing is figuring ou the physical
address of a piece of memory.
Most of the time, I get a pointer (virtual address) to a buffer and the
size of the buffer. From this, I need to get a set of physical
addresses, one for the start of each page on which the buffer lives.
There is a special situation where I know that the buffer is physically
contiguous, and therefore only need to get the physical address of the
first page.
The end goal is to take this physical address and give it to the bus
master engine on my PCI card so the card can DMA to or from that buffer.
I’ve been unable to find the routines or other documentation which tells
me how to do this. Any clues or pointers to docs would be appreciated.
And while I’m on the subject, is there some sample Neutrino pci driver
code lying around anywhere? Hey, I can dream, can’t I?
Thanks in advance,
Eric