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

Re: [Xen-devel] why we need to convert "mfn_to_page(smfn)" in page_alloc.c?



On Mon, 10 Dec 2012, asad raza wrote:
> void init_domheap_pages(paddr_t ps, paddr_t pe)
> {
>     unsigned long smfn, emfn;
> 
>     ASSERT(!in_irq());
> 
>     smfn = round_pgup(ps) >> PAGE_SHIFT;
>     emfn = round_pgdown(pe) >> PAGE_SHIFT;
> 
>     init_heap_pages(mfn_to_page(smfn), emfn - smfn);
> }

if you look the definition of init_heap_pages and mfn_to_page:

void init_heap_pages(struct page_info *pg, unsigned long nr_pages)
#define mfn_to_page(mfn)  (frame_table + (pfn_to_pdx(mfn) - 
frametable_base_mfn))

you should be able to understand why we need to call mfn_to_page

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.