2008/5/28 sahlot arvind <[EMAIL PROTECTED]>:
> I am trying to understand how can I read the pte using pte_page. Please
> could you explain?
>
> On 5/28/08, Cédric Augonnet <[EMAIL PROTECTED]> wrote:
>>
>> 2008/5/28 sahlot arvind <[EMAIL PROTECTED]>:
>> > I am working on Linux 2.6 and inside the init function of my module I am
>> > doing this -
>> >
>> > -------------
>> > init_module ()
>> > {
>> > va = kmalloc (4096, GFP_KERNEL);
>> > }
>> > --------------
>> >
>> > Now I want to read the page table entry for this va?
>> > What is the right way to do that?
>> > Thanks in advance
>> > - A
>> >
>>
>> Hi,
>>
>> Is it not the pte_page macro that you are looking for ?
>>
>> Cheers,
>> Cédric
>
>
>
> --
> http://linuxexplained.blogspot.com
Perhaps this would to the trick
struct mm_struct *mm = current->mm;
pgd = pgd_offset(mm, address);
pmd = pmd_offset(pgd, address);
pte = *pte_offset_map(pmd, address);
page = pte_page(pte);
Actually, you don't need the last line if i read your initial question
more carefuly... sorry
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ