Christian Kaiser wrote:
> Lu Baolu wrote:
>> On Wed, Dec 3, 2008 at 1:48 AM, Christian Kaiser <[EMAIL PROTECTED]> wrote:
>>> Hi all,
>>>
>>> I am currently porting a driver from Linux to Solaris.
>>>
>>> The Linux driver uses amongst others the following functions:
>>>
>>>   virt_to_phys()
>>>   virt_to_bus()
>>>   phys_to_virt()
>>>   bus_to_virt()
>>>
>>> As you can see, these functions translate virtual into physical or bus
>>> addresses and vice versa.
>>> Is there something similar available on Solaris? I am currently
>>> developing on SXCE b103.
>> Hi,
>>
>> You may refer to the code in rootnex_get_sgl(). You can find samples
>> there, but they are non-ddi.
>>
>> usr/src/uts/i86pc/io/rootnex.c, line 2393
>>
>> 2387 /*
>> 2388  * rootnex_get_sgl()
>> 2389  *    Called in bind fastpath to get the sgl. Most of this will be 
>> replaced
>> 2390  *    with a call to the vm layer when vm2.0 comes around...
>> 2391  */
>> 2392 static void
>> 2393 rootnex_get_sgl(ddi_dma_obj_t *dmar_object, ddi_dma_cookie_t *sgl,
>> 2394     rootnex_sglinfo_t *sglinfo)
> 
> Thanks!
> 
> I found out that hat_getpfnum() is used in rootnex_get_sgl(). I assume 
> that since hat_getkpfnum() (the k makes the difference!) is not 
> available on amd64, hat_getpfnum() (without k!) is the only way to find 
> out the page frame number? Is that correct?
> 
> Unfortunately, I don't know how the get the "hat" out of a virtual 
> address that would be the first parameter to hat_getpfnum(). In the 
> example it is taken from 'dmar_object' but I don't have such an object 
> in my code. What else can I do?

I can answer myself!

I can use 'kas.a_hat' as "hat" parameter. 'kas' stands for kernel 
address space and is the correct address space in my case!

Thank you!

   Christian

-- 
Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions
http//www.dolphinics.com
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to