参照元

説明

引数

返り値

参考

実装

ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 有効: drivers/base/dma-coherent.c

/**
 * 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;
        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;
                spin_lock_irqsave(&mem->spinlock, flags);
                bitmap_release_region(mem->bitmap, page, order);
                spin_unlock_irqrestore(&mem->spinlock, flags);
                return 1;
        }
        return 0;
}
EXPORT_SYMBOL(dma_release_from_coherent);

ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 無効: include/asm-generic/dma-coherent.h

#define dma_release_from_coherent(dev, order, vaddr) (0)

コメント


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-03-03 (木) 19:19:46