Re: Getting Physical address of a buffer
Re: Getting Physical address of a buffer
- Subject: Re: Getting Physical address of a buffer
- From: Shantonu Sen <email@hidden>
- Date: Fri, 6 Aug 2010 05:41:57 -0700
Use IOBufferMemoryDescriptor.
No, you cannot map arbitrary virtual addresses to physical, even for wired OSMalloc-ed buffers. If you are intending to use a buffer for DMA, use the appropriate APIs for allocating DMA-safe buffers.
Shantonu
On Aug 6, 2010, at 4:46 AM, Antoine Missout wrote:
> grep xnu for ml_vtophys
>
> However, it is not exported.
>
> - Antoine
>
> On 2010-08-05, at 2:10 PM, shailesh jain wrote:
>
>> Hello again!
>> I have a kernel extension (which is not an IOKit driver) that uses
>> OSMalloc_ KPI to allocate buffer. I pass in OSMT_DEFAULT so that
>> buffers that it returns are wired to memory. I have a use case where
>> in I would like
>> to get physical address of the first byte of the buffer. I understand
>> that buffer will not be contiguous in Physical memory and I am fine
>> with that. Do we have such an interface ---
>>
>> something like: physAddr = virt_to_phys(buffer); // Gives physical
>> address of first byte of the buffer
>>
>>
>> --
>> Shailesh Jain
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Darwin-kernel mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden