Jim Wintermyre writes:
> In my case, the hardware on our PCI device says it needs a 128 MB
> memory window (which is what shows up in the IO registry for
> IODeviceMemory for the device). However, for the way we are using
> the device, we don't actually need to use that entire memory window,
> so we'd like to tell the OS that we only *really* need, say, 32 MB.
If you take a look through the sources, it looks like what happens
when you map PCI memory is that it goes through several layers of
C++'isms to look up and map a physical memory descriptor created using
the PCI Base Address Register and length.
You might be able to somehow cleanly subclass IOPCIDevice and
IODeviceMemory to allow passing an offset/length for the mapping,
rather than having it use the entire range. Or you might be able to
somehow find the underlying memory descriptor, and use it to create a
new one based on a sub range. I don't have enough c++ fu for that,
and if I were doing this, I'd ignore all this
IOPCIDevice/IODeviceMemory stuff and read the BAR myself from PCI
config space, and create a new physical memory descriptor myself,
which covers just the range I needed. But I'm a Neanderthal :)
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden
This email sent to email@hidden