*参照元 [#e2a44181]
#backlinks

*説明 [#fa621326]
-パス: 複数あり
--ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 有効: [[linux-4.4.1/drivers/base/dma-coherent.c]]
--ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 無効: [[linux-4.4.1/include/asm-generic/dma-coherent.h]]
--[[linux-4.4.1/ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY]]

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


**引数 [#b2ae27d2]
-struct device *dev
--
--[[linux-4.4.1/device]]
-int order
--
-void *vaddr
--


**返り値 [#l7f3b135]
-int
--


**参考 [#zf36cceb]


*実装 [#g09fff9e]

**ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 有効: drivers/base/dma-coherent.c [#c1521458]

 /**
  * dma_release_from_coherent() - try to free the memory allocated from per-device coherent memory pool
  * @dev:        device from which the memory was allocated
  * @order:      the order of pages allocated
  * @vaddr:      virtual address of allocated pages
  *
  * This checks whether the memory was allocated from the per-device
  * coherent memory pool and if so, releases that memory.
  *
  * Returns 1 if we correctly released the memory, or 0 if
  * dma_release_coherent() should proceed with releasing memory from
  * generic pools.
  */
 int dma_release_from_coherent(struct device *dev, int order, void *vaddr)
 {
         struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
 
-
--[[linux-4.4.1/dma_coherent_mem]]

         if (mem && vaddr >= mem->virt_base && vaddr <
                    (mem->virt_base + (mem->size << PAGE_SHIFT))) {
                 int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
                 unsigned long flags;
 
-
--[[linux-4.4.1/PAGE_SHIFT]]

                 spin_lock_irqsave(&mem->spinlock, flags);
                 bitmap_release_region(mem->bitmap, page, order);
                 spin_unlock_irqrestore(&mem->spinlock, flags);
-
--[[linux-4.4.1/spin_lock_irqsave()]]
--[[linux-4.4.1/bitmap_release_region()]]
--[[linux-4.4.1/spin_unlock_irqrestore()]]

                 return 1;
         }
         return 0;
 }
 EXPORT_SYMBOL(dma_release_from_coherent);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]


**ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 無効: include/asm-generic/dma-coherent.h [#j2e4ae49]

 #define dma_release_from_coherent(dev, order, vaddr) (0)
-常に失敗する。


*コメント [#sd068db5]


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