*参照元 [#w9f65eff]
#backlinks

*説明 [#afc8c0a5]
-パス: [[linux-4.4.1/arch/arm/mm/dma-mapping.c]]

-FIXME: これは何?
--説明


**引数 [#d46c3978]
-struct device *dev
--
--[[linux-4.4.1/device]]
-size_t size
--
-pgprot_t prot
--
--[[linux-4.4.1/pgprot_t]]
-struct page **ret_page
--
--[[linux-4.4.1/page]]
-const void *caller
--
-bool want_vaddr
--


**返り値 [#ka3f0070]
-void *
--


**参考 [#w0018cef]


*実装 [#ef9f2ab7]

**CONFIG_MMU 有効 [#n4a7c02a]
-
--[[linux-4.4.1/CONFIG_MMU]]

 static void *__alloc_from_contiguous(struct device *dev, size_t size,
                                      pgprot_t prot, struct page **ret_page,
                                      const void *caller, bool want_vaddr)
 {
         unsigned long order = get_order(size);
         size_t count = size >> PAGE_SHIFT;
         struct page *page;
         void *ptr = NULL;
 
-
--[[linux-4.4.1/get_order()]]
--[[linux-4.4.1/PAGE_SHIFT]]
--[[linux-4.4.1/page]]

         page = dma_alloc_from_contiguous(dev, count, order);
         if (!page)
                 return NULL;
 
-
--[[linux-4.4.1/dma_alloc_from_contiguous()]]

         __dma_clear_buffer(page, size);
 
-
--[[linux-4.4.1/__dma_clear_buffer()]]

         if (!want_vaddr)
                 goto out;
 
         if (PageHighMem(page)) {
-
--[[linux-4.4.1/PageHighMem()]]

                 ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot, caller);
                 if (!ptr) {
                         dma_release_from_contiguous(dev, page, count);
                         return NULL;
                 }
-
--[[linux-4.4.1/__dma_alloc_remap()]]
--[[linux-4.4.1/GFP_KERNEL]]
--[[linux-4.4.1/dma_release_from_contiguous()]]

         } else {
                 __dma_remap(page, size, prot);
                 ptr = page_address(page);
-
--[[linux-4.4.1/__dma_remap()]]
--[[linux-4.4.1/page_address()]]

         }
 
  out:
         *ret_page = page;
         return ptr;
 }


**CONFIG_MMU 無効 [#obf83bfe]
 #define __alloc_from_contiguous(dev, size, prot, ret, c, wv)    NULL
-常に失敗する。


*コメント [#yad38b40]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS