IOKit objects are they loaded into a contiguous memory segment?
I was in the process of doing some driver optimization... I can reduce the amount of kernel memory used and memory copy times iff it is safe to assume IOKit objects are allocated into contiguous physical memory segments. To better explain... I have a firmware driver object that contains a firmware image ( unsigned short code01[] = { ...image..}; ) that a secondary driver we get a pointer to and then download this firmware to my adapter (adapter DMAs the firmware from the physical address I pass it). Currently I have the secondary driver allocate a contiguous memory segment and copy the image into that segment. I would like to avoid this if possible. Is it safe to simply allocate an IOMemoryDescriptor with a pointer to the image and the images length then call getPhysicalSegment to get the start of next segment I want the adapter to download (I have to DMA in chunks smaller then the whole firmware image). I think I know the answer but I keep swapping between working on different OSes (Window NT/2000, Solaris, Mac OS, and Mac OS X) and it becomes hard to keep things straight :{ .... so I thought I better ask to make sure. Thanks! -Shawn
participants (1)
-
Shawn Erickson