RE: Getting virtual address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 19-11-07 19:28, Talib Alim wrote: 
>>> You should look into kmap{,_atomic}() to map highmem.
>> 
>> So, if virtual_address retuned is in 0xdxxxxxxx than I can assume this is
>> mapped, otherwise I map it ? is this correct.
> 
> No, that's not the idea. If you look at kmap{,_atomic}() they return the 
> virtual address and when the page in question is not a highmem page turn 
> into a direct page_address() call (which is also the function you could and 
> should've used instead of your homegrown one).

To make things clear for me and anybody reading this post (and please confirm).

I should not use 

virtual_address = phys_to_virt(page_to_pfn(page) << PAGE_SHIFT);

(I assume this is what you meant by home grown)

and should use

virtual_address = kmap_atomic(page, KM_USER0);

and when done, use 

kunmap_atomic(virtual_address, KM_USER0);

is KM_USER0 correct ?
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux