Hmm, no bites, so let me try again. Is there any way in OS X for a
device driver to get a query from the OS about what the OS thinks the
device's resource requirements are, which the driver can then modify
and return to the OS *before* the OS actually allocates those
resources?
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.
Without changing the hardware, if possible. :)
My Windows counterparts are making fun of me because they can do this
in Windows...
Thanks,
Jim
At 4:12 PM -0700 4/30/07, Jim Wintermyre wrote:
I have a PCI device that has a large memory footprint (128 MB).
This device memory size is hardwired into the chip, and we can't
change it there. However, for our use of this device, we don't
actually need all that memory, and in fact we only map about half of
it. I'm wondering if there's some way for the driver to tell the OS
that the requirements are actually different from what the hardware
reports?
On Windows, there is IRP_MN_QUERY_RESOURCE_REQUIREMENTS. The Win
driver expert here tells me this allows the driver to tell the OS
that the requirements are different from what the hardware reports,
*before* the OS allocates any resources for the device.
This would be useful because we don't want to have the OS allocate
resources that we don't really need, but there's another reason. We
have an ExpressCard version of the same device, and it turns out
that in the MacBook Pro, there is fixed 128 MB memory limit for
hot-plugged devices. This means that our device only works when it
is plugged in at boot. If we could change the memory requirements
via the driver, then hot-plugging post-boot would work.