*参照元 [#q6734d7e] #backlinks *説明 [#q581c67c] -パス: 複数あり --版: [[linux-2.6.33/include/linux/mm.h]] --版: [[linux-2.6.33/include/linux/mm.h]] --版: [[linux-2.6.33/mm/highmem.c]] -FIXME: これは何? --説明 -関連する関数 --[[linux-2.6.33/page_address()]] --[[linux-2.6.33/set_page_address()]] --[[linux-2.6.33/page_address_init()]] **引数 [#zf6e53b5] -struct page *page -- --[[linux-2.6.33/page]] **返り値 [#eea20095] -void * -- **参考 [#m0588cd3] *実装 [#d48b89e9] **版 [#i766a32e] #if defined(WANT_PAGE_VIRTUAL) - --[[linux-2.6.33/WANT_PAGE_VIRTUAL]] #define page_address(page) ((page)->virtual) (略) #endif **版 [#i1e0e44f] - include/linux/mm.h の宣言部分 #if defined(HASHED_PAGE_VIRTUAL) - --[[linux-2.6.33/HASHED_PAGE_VIRTUAL]] (略) void *page_address(struct page *page); (略) #endif --[[linux-2.6.33/HASHED_PAGE_VIRTUAL]] /** * page_address - get the mapped virtual address of a page * @page: &struct page to get the virtual address of * * Returns the page's virtual address. */ void *page_address(struct page *page) { unsigned long flags; void *ret; struct page_address_slot *pas; - --[[linux-2.6.33/page_address_slot]] if (!PageHighMem(page)) return lowmem_page_address(page); - --[[linux-2.6.33/PageHighMem()]] - --[[linux-2.6.33/lowmem_page_address()]] pas = page_slot(page); ret = NULL; - --[[linux-2.6.33/page_slot()]] spin_lock_irqsave(&pas->lock, flags); - --[[linux-2.6.33/spin_lock_irqsave()]] if (!list_empty(&pas->lh)) { struct page_address_map *pam; - --[[linux-2.6.33/list_empty()]] - --[[linux-2.6.33/page_address_map]] list_for_each_entry(pam, &pas->lh, list) { - --[[linux-2.6.33/list_for_each_entry()]] if (pam->page == page) { ret = pam->virtual; goto done; } } } done: spin_unlock_irqrestore(&pas->lock, flags); - --[[linux-2.6.33/spin_unlock_irqrestore()]] return ret; } EXPORT_SYMBOL(page_address); -特にライセンスを区別せずにシンボルを公開する。 --[[linux-2.6.33/EXPORT_SYMBOL()]] **版 [#c697857a] #if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL) - #define page_address(page) lowmem_page_address(page) - --[[linux-2.6.33/lowmem_page_address()]] (略) #endif *コメント [#b85bcfa2]