lkml.org 
[lkml]   [2010]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: dear list
On Thu, Sep 02, 2010 at 02:51:48PM +0800, gaoqiang wrote:
>I'm a newbie and got some question when learning the linux kernel
>
>about a macro:
>
>page_to_pfn(pg)
>
>I traced its definition,and finally got that:
>
>#define __page_to_pfn(page) ((unsigned long)((page) - mem_map) +
>ARCH_PFN_OFFSET)
>
>
>why hot ((unsigned long)((page)-mem_map + ARCH_PFN_OFFSET)/sizeof
>(struct page)
>

Sorry for the really long delay.

That is because both 'page' and 'mem_map' have type 'struct page *'.


\
 
 \ /
  Last update: 2010-10-14 07:17    [W:0.059 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site