Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS X IOKit equivalent for IRP_MN_QUERY_RESOURCE_REQUIREMENTS?



Well, if the IODeviceMemory is published in IOReg then it must be a property associated with a driver.  Assuming you are sub-classing said driver then you can get/set this property. This may or may not help you, it depends on what you mean by ".. query from the OS about what the OS thinks the ... requirements are".  I've not played with PCI so I have no idea how this would work.  I'd spend some time in the Darwin sources (searching on say, IODeviceMemory) to see if there is any code which highlights how this property is used.  OR if the method that publishes the property is overridable (something like say mapDeviceMemoryWithRegister() in IOKit/pci/IOPCIDevice.h).  Again, I have no experience with PCI so overriding something that the base class is doing may lead to a machine in a bad state...

Cheers,
-H.

On 10/05/07, Jim Wintermyre <email@hidden> wrote:
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.
>
>http://msdn2.microsoft.com/en-us/library/ms806388.aspx
>
>Is there a similar mechanism in IOKit?
>
>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.
>
>Thanks,
>Jim
_______________________________________________
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

 _______________________________________________
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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.