Re: PFN to Base Address

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

 



On 11/15/06, Bithika Khargharia <bithika@xxxxxxxxx> wrote:
Hi,

1. Given the PFN, how do I obtain the base physical address for the PFN.

I use
             'pfn <<12'.

Is this correct?

Yes 'pfn << PAGE_SHIFT' gives physical-base-address although its
better to use page_to_phys macro


2. Does the kernel generate PFN serailly from 0 to TOTAL_PHYS or are there
breaks in between?


Yes serially for x86 from 0UL but might contain some starting offset
according to some architectures. Take a look at page_to_phys macro
(http://lxr.free-electrons.com/source/include/asm-i386/io.h#101) and
__page_to_pfn macro
(http://lxr.free-electrons.com/source/include/asm-generic/memory_model.h#032)


--
Fawad Lateef

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