lkml.org 
[lkml]   [2001]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: pte_page
Brian Gerst wrote:
>
> mdaljeet@in.ibm.com wrote:
> >
> > I use the 'pgt_offset', 'pmd_offset', 'pte_offset' and 'pte_page' inside a
> > module to get the physical address of a user space virtual address. The
> > physical address returned by 'pte_page' is not page aligned whereas the
> > virtual address was page aligned. Can somebody tell me the reason?
> >
> > Also, can i use these functions to get the physical address of a kernel
> > virtual address using init_mm?
>
> pte_page() returns the struct page * for the page, not the page
> address. To get the physical address of a page use __pa(virtaddr), but
> this works if and only if the page is not highmem and not vmalloced.

Oops, I forgot that you said user page... __pa() only works for kernel
addresses. I don't see any other macros that can help you. Maybe one
of the VM gurus can add something here?

--

Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:54    [W:0.027 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site