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[2]: How do I get physical address of my buffer



Hi all,

I feel I find a bug in IOKit. IOBufferMemoryDescriptor class has own
getPhysicalSegment method. And it does not check the value of "
length" parameter.

getPhysicalAddress method of IOMemoryDescriptor means
getPhysicalSegment(0, 0). So IOBufferMemoryDescriptor::
getPhysicalSegment gets 0 for "length" parameter and it causes crash.

I posted this to radar #2860062


Regards,

Zak


at 02.2.13 16:04, Kazutaka 'Zak' Sawa wrote:
>Hi all,
>
>I tried the following but it still goes crash......
>
> MyDesc = IOBufferMemoryDescriptor::withCapacity(kMyBufferSIze,
> kIODirectionOut,
> true);
>
> MyVirAddr = MyDesc->getBytesNoCopy();
>
>-> MyPhyAddr = MyDesc->getPhysicalAddress();
>
>Could someone let me know the pointer that written about these issue ?
>
>Best Regards,
>
>Zak
>
>
>at 02.2.12 19:01, Kazutaka 'Zak' Sawa wrote:
>>Hi all,
>>
>># Sorry, I missed to send a mail > admin-san
>>
>>How do I get physical address of my buffer created by
>>IOBufferMemoryDescriptor ?
>>
>>My current code is the followings. This is called at my start method.
>> If my driver calls getPhysicalAddress (both), kernel crash is
>>occurred. What should I do before I call getPhysicalAddress ?
>>
>>
>> MyDesc = IOBufferMemoryDescriptor::withCapacity(kMyBufferSIze,
>> kIODirectionOut,
>> true);
>>
>> MyMap = MyDesc->map(kIOMapAnywhere
>> | kIOMapInhibitCache);
>>
>> MyVirAddr = MyMap->getVirtualAddress();
>>
>>-> MyPhyAddr = MyMap->getPhysicalAddress();
>>-> MyPhyAddr = MyDesc->getPhysicalAddress();
>>
>># I test MyMap-> and MyDesc-> but both cause kernel crash...
>>
>>
>>Regards,
>>
>>Zak
>>
>><<<< Kazutaka Sawa * yano ELECTRIC CO.,LTD.* >>>>
>><<<< >>>>
>><<<< E-Mail. mailto:email@hidden >>>>
>><<<< URL. http://www.yano-el.co.jp/ >>>>
>><<<< Tel. +81-78-993-0001 Fax. +81-78-997-6491 >>>>
>>_______________________________________________
>>darwin-drivers mailing list | email@hidden
>>Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/
>listinfo/darwin-drivers
>>Do not post admin requests to the list. They will be ignored.
>
><<<< Kazutaka Sawa * yano ELECTRIC CO.,LTD.* >>>>
><<<< >>>>
><<<< E-Mail. mailto:email@hidden >>>>
><<<< URL. http://www.yano-el.co.jp/ >>>>
><<<< Tel. +81-78-993-0001 Fax. +81-78-997-6491 >>>>
>_______________________________________________
>darwin-drivers mailing list | email@hidden
>Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/
listinfo/darwin-drivers
>Do not post admin requests to the list. They will be ignored.

<<<< Kazutaka Sawa * yano ELECTRIC CO.,LTD.* >>>>
<<<< >>>>
<<<< E-Mail. mailto:email@hidden >>>>
<<<< URL. http://www.yano-el.co.jp/ >>>>
<<<< Tel. +81-78-993-0001 Fax. +81-78-997-6491 >>>>
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.



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.