I have a processor board on a PCI bus that communicates with
applications on the host via shared memory and message passing.
Both the shared memory and the message passing are managed by
the driver that talks to a matching driver on the PCI board O/S.
Currently, the shared memory is created using AllocateCommonBuffer,
then application programs map the buffer using a DeviceIoControl
that uses MmMapLockedPagesSpecifyCache. This seems to work,
except that I'm allocating tens of megabytes of common buffers,
which seems a little impolite.
I am looking at instead locking down memory allocated in user
mode, using a DeviceIoControl and METHOD_DIRECT, then using
MapTransfer to get mappings of that memory, page at a time
(scattered pages are OK for the target board) that the target
board can use to randomly access those pages.
The problem here is that I'm only able to get some 65000 map
registers for each board, begging the question "Am I trading
one precious resource for another?"
Another problem is that I'm not certain that pages thusly mapped
are directly mapped, or if I'm actually getting an internal
trampoline buffer that will need to be flushed periodically.
And what is really the story with these "map registers" when
the device is a bus mastering PCI device that can generate
32bit addresses on a 32bit system?
I'm not immediately concerned about 64bit systems, but I do want
to keep them in mind as they are starting to be interesting. But
of course even 32bit systems with PAE will have extended addresses,
although my hardware currently only generates 32bit addresses.
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."