Re: How to read Page Table Entry in the linux kernel module?

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

 



On Wed, 28 May 2008 16:14:54 +0200
"Cédric Augonnet" <cedric.augonnet@xxxxxxxxx> wrote:

> 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

You will want to check for a NULL pointer at each step, btw.

Look at the function follow_page() in mm/memory.c for an example.

-- 
All rights reversed.

--
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