public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* dear list
@ 2010-09-02  6:51 gaoqiang
  2010-10-14  5:18 ` Américo Wang
  0 siblings, 1 reply; 2+ messages in thread
From: gaoqiang @ 2010-09-02  6:51 UTC (permalink / raw)
  To: linux-kernel

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)



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dear list
  2010-09-02  6:51 dear list gaoqiang
@ 2010-10-14  5:18 ` Américo Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Américo Wang @ 2010-10-14  5:18 UTC (permalink / raw)
  To: gaoqiang; +Cc: linux-kernel

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 *'.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-14  5:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-02  6:51 dear list gaoqiang
2010-10-14  5:18 ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox