Re: porting a mm specific macro from 2.4 to 2.6

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

 



Hi,

Vikas Aggarwal wrote:

#define __vpa(va)
((pte_val(*pte_offset(pmd_offset(pgd_offset_k(va),(va)),(va))) &
PAGE_MASK) + (va & ~PAGE_MASK))

What is supposed to do this macro ? As far as I understand it, it's supposed to convert a virtual address into a physical one by traveling through the page tables. Is that it ?

If yes, then the virt_to_phys() macro already does the job, but only for kernel virtual addresses (I think, I only had a quick look at the code). Directly translating user virtual addresses to physical addresses is, I think, a bad idea, because user stuff might be swapped.

Then, can you give more details about the context of use ? (The code of the function is which it is used for example).

Sincerly,

Thomas
--
Thomas Petazzoni
thomas.petazzoni@xxxxxxxx

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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