首页 > 代码库 > 核心游记之 page_address_init

核心游记之 page_address_init

lock_kernel()仅仅虚晃一枪就过去了.

紧接着来的是page_address_init

include/linux/mm.h

?

#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
#define HASHED_PAGE_VIRTUAL
#endif

宏CONFIG_HIGHMEM 在系统中是没有定义的

WANT_PAGE_VIRTUAL 在系统中也是没有定义的

?

#if defined(WANT_PAGE_VIRTUAL)
#define page_address(page) ((page)->virtual)
#define set_page_address(page, address)??????????? /
??? do {??????????????????????? /
??????? (page)->virtual = (address);??????? /
??? } while(0)
#define page_address_init()? do { } while(0)
#endif

这个不是

?

#if defined(HASHED_PAGE_VIRTUAL)
void *page_address(struct page *page);
void set_page_address(struct page *page, void *virtual);
void page_address_init(void);
#endif

这个也不是

?

#if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL)
#define page_address(page) lowmem_page_address(page)
#define set_page_address(page, address)? do { } while(0)
#define page_address_init()? do { } while(0)
#endif

就这个了,也是空操作!!!

?

ps:某些平台就定义了CONFIG_HIGHMEM 比如: ppc/stx_gp3,说明这些是平台相关的.

核心游记之 page_address_init