参照元

説明

引数

返り値

参考

実装

CONFIG_HAS_DMA 有効: include/asm-generic/dma-mapping-common.h

static inline void *dma_alloc_attrs(struct device *dev, size_t size,
                                       dma_addr_t *dma_handle, gfp_t flag,
                                       struct dma_attrs *attrs)
{
        struct dma_map_ops *ops = get_dma_ops(dev);
        void *cpu_addr;
        BUG_ON(!ops);
        if (dma_alloc_from_coherent(dev, size, dma_handle, &cpu_addr))
                return cpu_addr;
        if (!arch_dma_alloc_attrs(&dev, &flag))
                return NULL;
        if (!ops->alloc)
                return NULL;
        cpu_addr = ops->alloc(dev, size, dma_handle, flag, attrs);
        debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr);
        return cpu_addr;
}

CONFIG_HAS_DMA 無効: include/asm-generic/dma-mapping-broken.h

static inline void *dma_alloc_attrs(struct device *dev, size_t size,
                                    dma_addr_t *dma_handle, gfp_t flag,
                                    struct dma_attrs *attrs)
{
        /* attrs is not supported and ignored */
        return dma_alloc_coherent(dev, size, dma_handle, flag);
}

コメント


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