参照元

説明

引数

返り値

参考

実装

CONFIG_FLATMEM 有効

#define __page_to_pfn(page)     ((unsigned long)((page) - mem_map) + \
                                 ARCH_PFN_OFFSET)

CONFIG_DISCONTIGMEM 有効

#define __page_to_pfn(pg)                                               \
({      const struct page *__pg = (pg);                                 \
        struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg));     \
        (unsigned long)(__pg - __pgdat->node_mem_map) +                 \
         __pgdat->node_start_pfn;                                       \
})

CONFIG_SPARSEMEM_VMEMMAP 有効

#define __page_to_pfn(page)     (unsigned long)((page) - vmemmap)

CONFIG_SPARSEMEM 有効

/*
 * Note: section's mem_map is encoded to reflect its start_pfn.
 * section[i].section_mem_map == mem_map's address - start_pfn;
 */
#define __page_to_pfn(pg)                                       \
({      const struct page *__pg = (pg);                         \
        int __sec = page_to_section(__pg);                      \
        (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \
})

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS